question_score
stringclasses
21 values
title
stringlengths
6
119
question_userid
stringlengths
4
10
question_user
stringlengths
3
20
question_user_score
stringclasses
496 values
question_datetime
stringdate
2014-02-01 23:57:31
2023-04-02 01:40:15
question
stringlengths
0
11k
question_id
stringlengths
1
6
answer_count
stringclasses
8 values
answer_id
stringlengths
0
6
answer_score
stringclasses
18 values
answer_userid
stringclasses
946 values
answer_user
stringclasses
963 values
answer_user_score
stringclasses
692 values
answer_datetime
stringlengths
0
19
answer
stringlengths
0
10.7k
0
Help With Restricting Player Movement For A Cutscene?
459692218
Nckripted
580
2020-06-21 22:31:16
<p>Currently I am making a Piggy-based game with some twists with another user. Recently, we are done with the main basics (keys, doors, menu, etc.) and I have decided to start on the cutscene. However, I don't want player movement, but I can't set their walk speed to 0 because they will be moving. I have heard that Co...
107027
1
98479
1
168891080
YAYAYGPPR
82
2020-06-21 22:36:53
<p>That has a very simple solution. You just want to anchor the players HumanoidRootPart and bam, they can't move.</p> <pre class='brush: lua'>player.Character.HumanoidRootPart.Anchored = true -- makes unable to move player.Character.HumanoidRootPart.Anchored = false -- makes able to move </pre> <p>In the 'player' part...
3
How do I add a player to a table in a script when a TextBox contains their name?
38498021
capinbuilda
15
2015-06-26 18:22:59
<p>I have a script for manually putting a player in the banlist in ROBLOX Studio, but I'm wondering how I could add people to the banlist in-game using a TextBox.</p> <pre class='brush: lua'>local BannedList = { ["PlayerX"] = true; ["PlayerY"] = true; ["PlayerZ"] = true; } function NewPlayer(pl) if Bann...
18969
0
How to properly test dev products/gamepasses?
436466229
trecept
367
2018-06-01 16:32:20
<p>I owned a game a long time ago, where I used mock purchases in studio to test developer products and gamepasses (all went well). However in game, one of my friends bought a gamepass and did not get the benefits? Which is similar to errors in studio and errors in the actual game I assume. Would starting a server in s...
59425
0
What do i need to put into a StarterCharacter model for it to work?
306209
PoePoeCannon
484
2018-03-24 02:21:37
<p>On the wiki is says that i can put a model named 'StarterCharacter' into the StarterPlayer folder, so i do that, but it doesnt work when i play the game, the model i made just spawns and falls apart and the camera isnt even attached to it.</p> <p>If anyone knows what requirements are needed for the model to work tha...
55537
0
How to make a script that gives you a sword?
22026745
raystriker6707
30
2014-06-12 15:30:06
<p>I am trying to make a script that when you step on a block (part) it gives a sword.</p>
6550
2
8677
5
49352468
fireboltofdeath
630
2014-06-12 15:53:17
<pre class='brush: lua'>script.Parent.Touched:connect(function(t) player = game.Players:GetPlayerFromCharacter(t.Parent) if player then wait() game.Lighting["Sword"]:Clone().Parent = player.Backpack end end) </pre> <p><strong>Hope I helped!</strong></p>
0
Which is better to use, string.format or concatenation?
2966752
Validark
1534
2015-08-31 21:48:53
<p>In this case, I'm assuming that both can be used easily.</p> <p>There are some cases, such as the following, where string.format can come in handy, because of it's ability to use to to make sure that the script puts in a 0 in the tens digit if the seconds are only at 8 or something. Are there any other cases or thin...
22197
2
25825
4
5374190
ClimaxDarkness
165
2015-08-31 21:55:29
<p>String.gsub is also a useful function worth considering, it can replace any found parts of a string with a new part just like string.format does. E.g. if you wanted to create a time formatter, you could do something like this</p> <pre class='brush: lua'>local Format = "HH:MM" local hour = 14 local minute = 18 Format...
1
How would i move a model using vector3 slowly?
32615243
Supergamerboy1995
129
2016-07-29 03:54:12
<p>So here i have the script to move my model to a position...</p> <pre class="brush: lua">thing = workspace.Tornado thing:MoveTo(Vector3.new(0,0,0)) </pre> <p>...But how can i make it so it "floats" or "glides" to that position, rather than just teleport to that position?</p>
33788
0
How to get universeId from the Roblox Api?
553254676
arkadiusz54
2
2019-06-25 14:58:34
<p>I have a problem to get the universeId from that jsontable i get from the API.</p> <pre class='brush: lua'>local ReplicatedStorage = game:GetService("ReplicatedStorage") local getgamesevent = game.ReplicatedStorage.Databases.SetGame local HttpService = game:GetService("HttpService") local function ongetgameFired(pla...
82481
0
How can I make a click detector gui?
529859410
JackyW9cky
18
2020-07-28 16:10:45
<p>So, in my game, I have been trying to make something when you click a click detector, a gui will pop up. I have searched the whole internet for an answer, but I couldn't find any. This has been a question for me for a while, and now I want to answer it.</p>
110165
0
How do i make FireServer() but only for one player?
951032294
Tayshift
6
2020-08-29 15:04:35
<p>Hello, I am using a module to detect the players ViewportSize. As you can only detect it on a local script.</p> <p>So I need the local script to fire a remote event to the server script but it fires to all the players.</p> <p>Help would be appreciated.</p>
112354
0
How to fix glitch ? (Animation Idle Staying even after I unequip the sword)
1432900944
JohnyKenny12
0
2022-06-20 14:01:35
<p>The sword named Nichirin, here the code:</p> <pre class='brush: lua'>local module = {} function foundkatanatool(char) wait(.1) local tool = char:FindFirstChildWhichIsA("Tool") if tool then local typ = tool:FindFirstChild("Type") if typ and typ.ClassName == "StringValue" and typ.Value == "...
130419
12
SpotLight Color the Color of Players Head?
16826035
YellowoTide
1992
2014-04-21 02:26:21
<p>So this is the script I have. It has some other stuff in it but I'm confused on the spotlight.color thingy. If you find any other errors with the scripts feel free to tell me :D</p> <pre class='brush: lua'>wait() player = game.Players.LocalPlayer player.CameraMode = Enum.CameraMode.LockFirstPerson SpotLight = Instan...
3096
3
4350
4
1552633
soaprocks2
75
2014-04-21 02:29:05
<p>Parts don't have Colors, instead they have BrickColors.</p> <pre class='brush: lua'>wait() player = game.Players.LocalPlayer player.CameraMode = Enum.CameraMode.LockFirstPerson SpotLight = Instance.new("SpotLight", player.Character.Head) SpotLight.Brightness = (.85) SpotLight.Angle = (120) SpotLight.Color = player.C...
1
How do i make a VR script, Im trying to get the controller positions and the headset position?
417648663
dimondflash57
64
2020-06-30 00:54:48
<p>Im making a VR script for fun all i want to know is how do i get the right/left controller positions? i made the hand's <code>If you dont know do not respond to this question.</code></p> <pre class='brush: lua'> local vr = game:GetService("VRService") local hand1 = Instance.new("Part",workspace.Andrew_KnowsRBLX) ...
107806
1
99100
1
617445798
TTChaos
749
2020-06-30 01:45:12
<p>Use <code>VRService:GetUserCFrame</code></p> <pre class='brush: lua'>local VRService = game:GetService("VRService") local Character = workspace.Andrew_KnowsRBLX local LeftHand = Instance.new("Part", Character) local RightHand = Instance.new("Part", Character) RightHand.Name = "Right Hand" LeftHand.Name = "Left Hand"...
0
is there a way to find out if a player is moving?
105105986
trubudist
40
2016-08-17 22:35:59
<p>this isnt a request, just wondering if there is a way to do this</p>
34668
0
Animation is wrong when the player does it but works on rig?
346210372
LiffisBiffis
17
2022-11-19 20:34:10
<p>I am currently trying to make an animation that makes the player hold a ball. When I animated it on the rig, it was fine. Playing it on the rig I animated it on is fine as well, but when I try it on the player, it looks like this:</p> <p><a target="_blank" href="https://imgur.com/a/Og7pMHp">Photo</a></p> <p>This is ...
132319
2
Break a loop after it runs after a certain amount of times?
434535742
Masmixel
21
2021-04-02 23:05:23
<p>I'm working on a basic wave spawner, I need this loop to end after it runs a certain amount of time.</p> <pre class='brush: lua'>local spawnamount = game.Workspace.Live.spawnamount.Value local multiplier = 20 -- the amount that will eventually add onto the total amount after a wave. local shrieker = game.ReplicatedS...
121950
0
Why does my camera script using CFrame not work when I test it out?
111800874
FilipinoWrld
16
2021-02-16 13:43:50
<p>I recently learned how to move cameras with <a target="_blank" href="https://www.youtube.com/channel/UCS2smVWjNGuRzD6HVWmlWwQ">TheDevKing</a> but he didn't explain how to move a camera using CFrame so I tried to do it myself with the help of the roblox DevHub but it didn't work. Is there any error in my script that ...
120233
0
How would I get the leader with the most kills in the game?
1053072695
zomspi
546
2020-03-26 01:36:50
<p>How would I loop through every player in a table then make a variable for the player with the highest amount of kills, and then if someone else overtakes their place the variable changes to that player?</p>
97096
1
89647
1
74087102
Ziffixture
5655
2020-03-26 02:02:54
<p>You can use the <code>table.sort</code> function. By supplying a predication argument, you can tell <code>table.sort</code> how it should sort the array based on each value compared: <code>a</code>, <code>b</code>. By creating our predication function and filtering with the <code>&gt;</code> greater-than operator, w...
0
how do I change the camera position?
1941346777
Dianetter7B
4
2021-02-25 22:15:16
<p>hi. so i'm trying to make a game where if you click a button you can change the cameras position to a new one can I get some help on this? this is the current script i have but doesnt work</p> <pre class='brush: lua'>camera = workspace.Camera wait(1) camera.Position = workspace.Camerapart camera.CameraType = Scripta...
120684
1
109992
0
232623022
2_MMZ
265
2021-02-25 22:17:01
<p>You need to identify the Camera with <code>Local</code> such as:</p> <pre class='brush: lua'>local Camera = game.Workspace.Camera </pre> <p>You must also use <code>CFrame</code> for your camera.</p> <pre class='brush: lua'>Camera.CFrame = game.Workspace.Camerapart.CFrame </pre> <p>Then, for the <code>CameraType</cod...
1
humanoid.running function not firing if i walk in a direction for too long?
1624504218
GameBuilderLol
58
2021-12-22 06:14:06
<p>so the funtion fires if i walk but if i continue walking in that direction for a while it doesnt fire unless i change directions</p> <pre class="brush: lua">local human = script.Parent:WaitForChild("Humanoid") local debounce = false human.Running:Connect(function() if not debounce then debounce = true ...
128380
1
116301
1
153125476
co_existance
141
2021-12-22 19:23:34
<p>humanoid.Running only fires when the WalkSpeed of the humanoid changes. try using this instead</p> <pre class="brush: lua">local human = script.Parent:WaitForChild("Humanoid") local debounce = false while humanoid.MoveDirection.Magnitude &gt; 0 do --// Checks if the HumanoidRootPart of the character is moving using ...
0
How can I enable the player controls in a server script?
321147068
iiFloxy
9
2022-11-16 19:03:08
<p>I have an issue where If I die while playing an animation that disables my controls, the player won't be able to move after respawning. I need to be able to discern when the player dies, which (I believe) is only able to be done server side, but I also need to be able to enable the controls, which can only be done c...
132295
2
119508
0
1929477313
Kingu_Criminal
205
2022-11-19 11:15:00
<p>Just put a localscript in StarterCharacterScripts (It will run whenever the character spawns) and enable the controls from there</p>
0
My walk script sometimes stops the humanoid for some reason?
267576543
zaqree512345
3
2022-11-20 16:10:26
<p>So, I'm making an RPG game, and my enemies sometimes break. They don't move at all! There are no errors or anything, they just stop working.</p> <p>There's a few other things in my code, like the exp on death and stuff, but here's the loop:</p> <pre class='brush: lua'>while true do local low = script.Parent.Dete...
132324
0
How do i prevent people not dying on the killbricks?
189040112
JumpyDJames
7
2020-07-26 18:51:33
<p>I have a lot of kill bricks and use this code: <em>script.Parent.Touched:connect(function(hit) if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end)</em> but the thing is some people can keep jumping on them and somehow survive. I don't know how to prevent them ...
110023
1
101154
0
1522202318
NathanBlox_Studios
212
2020-07-27 08:01:00
<p>When you want to type a script, click the blue Lua button</p> <p>It might have been a glitch or a slow reaction, you might be able to stop it using loops</p> <p>(Put this in the killbrick)</p> <pre class='brush: lua'>script.Parent.Touched:Connect(function(hit) repeat hit.Parent.Humanoid.Health = 0 ...
0
How to tell if the player is touching the ground?
20280887
tygerupercut3
68
2018-03-14 03:19:03
<p>So I have a shovel tool and I only want it to activate if the player is touching the ground (not jumping, falling, etc.). Is there some code that Roblox has for identifying if the player is on the ground or is there some way I could make a script for this. Im not familiar with any commands that would make this work....
55036
3
53902
5
273093957
Rare_tendo
3000
2018-03-14 18:11:37
<p>Humanoid.FloorMaterial</p> <p>http://wiki.roblox.com/index.php?title=API:Class/Humanoid/FloorMaterial</p> <p>Description : This property contains the Material of the part or terrain cell that the Humanoid is currently standing on (as calculated in the last Humanoid step). If the Humanoid is not currently standing on...
1
Change grip weld to motor6d?
551879230
Ribasu
127
2018-07-18 14:19:33
<p>Hi, I'm having a hard time animating tools; I have found the following piece of <a target="_blank" href="https://devforum.roblox.com/t/animating-a-player-as-well-as-a-tool/80193">advice</a>:</p> <blockquote> <p>you will need to convert the grip weld to a motor6d</p> <p>You will need to convert it to a motor6d with a...
63106
1
61456
2
160570032
Omega_bs
40
2018-07-19 07:32:14
<p>Hello there, i'm sorry i can't write the entire tutorial here since it has a 10,000 Characters limit</p> <p>I have however ported it to Pastebin raw</p> <p>It may not look neat so read it as comfortable as you are.</p> <p><a target="_blank" href="https://pastebin.com/rgfJQyxH">The Pastebin</a></p> <p>it is a entire ...
2
I need help! Can someone give me there version of a sword giving script?
375458023
tane011
12
2020-11-21 17:34:15
<p>I NEED HELP WITH THIS! I need to let the script know who is getting the sword and giving that person the sword when they press the button! Can someone help me, please?</p> <p>My current script: (I need help with the "Player" part!)</p> <pre class='brush: lua'>local Button = script.Parent local Sword = game.Lighting....
116108
2
106561
0
130021889
SpeedyTV_1
76
2020-11-21 17:43:18
<p>This should solve your problems.</p> <pre class='brush: lua'>local Button = script.Parent local Sword = game.Lighting.ClassicSword Button.MouseButton1Click:Connect(function(Player) -- the player is defined here as the person who clicked the button Sword:Clone() Sword.Name = "Starter Sword" Sword.CanBeDro...
0
Why does the output keeps on printing even I put debounce?
1792778813
Xapelize
2326
2020-02-23 03:53:33
<h1>Please note this is a old post, so the time when I posted this I was a young kid and a noob, please don't complain</h1> <p>GIF preview are not public due to private issues.</p> <pre class='brush: lua'>local part = script.Parent local ceiling = workspace.ce debounce = false function ontouched() debounce = true ...
95056
1
87813
1
322220443
GeneratedScript
740
2020-02-23 04:14:00
<p>So the problem is that you're printing ("Touching") or ("Touch Ended") for each touch, not connecting to the actual function. You're also not waiting between them and instantly setting the debounce to true/false.</p> <p>To fix it: 1) Delete the lines that say <code>print()</code> and <code>end)</code>.</p> <p>2) Hav...
0
player.Character:GetExtentsSize() doesn't return the offset used from the head?
15631081
Uglypoe
557
2016-05-01 18:38:16
<p>I'm making a script where you can freeze other players. The players have morphs as well, which are stored inside of the player's character. This means that :GetExtentsSize() gets the correct size of the entire player model, but it doesn't return the offset used to make it. According to the wiki, it uses an offset ba...
30186
1
33556
1
2155311
EgoMoose
802
2016-05-01 20:38:30
<p>Hmm, seems the wiki was wrong about that. I'll take a look into that and fix it, but I'm curious what the previous writer meant by having a vector3 that represents size be aligned to a position. That doesn't seem possible to me given all that's returned is a size vector 3????</p> <p>Anyways...</p> <p>For your purpos...
0
The &quot;ON&quot; Button Broken when you disable Bloom?
147305218
PeterParker17386
16
2022-10-09 20:27:04
<p>Im making a game that includes bloom and im trying to make a setting that disables and turns it on for pcs that are not as good, but the "ON" button does not work when you turn it off. This is the code for it:</p> <pre class='brush: lua'>local Bloom = game.Lighting.Bloom script.Parent.MouseButton1Down:Connect(functi...
131839
1
119072
0
110029109
loowa_yawn
383
2022-10-09 21:35:26
<p>Instead of changing the properties of the Bloom, try using Enabled instead. It allows you to enable or disable the bloom without the properties being affected.</p> <pre class='brush: lua'>local Bloom = game.Lighting.Bloom script.Parent.MouseButton1Down:Connect(function() Bloom.Enabled = true end) </pre>
2
How can I make a gui shop with images?
4694638
alan3401
28
2014-03-01 21:18:31
<p>I want to make a gui shop with images showing the model and the price of it. How can I make this?</p>
411
0
How to check boolean in table with a corresponding name?
698511703
PufferfishDev
44
2021-09-14 21:30:10
<p>Hi. I'm making a keycard system and I need to know how to read a table that works something like this</p> <pre class='brush: lua'>local cards = { ["a"] = true, ["b"] = true, ["c"] = true, ["d"] = false, ["e"] = true, ["f"] = false } </pre> <p>and return if it's true or false, and call it for ...
127445
1
how do i make it so that people dont loose there item?
391170608
superspeedr1234
60
2020-06-09 03:24:41
<p>this works in the way that the player gets the item and when he/she resets/dies they will get it in there inventory and what doesn't work is that other players when they die the item stays in server storage and its a problem when it leaves the inventory, in general, how would I fix this thank you</p> <pre class='bru...
105825
1
97476
1
1348670747
Utter_Incompetence
816
2020-06-09 03:27:37
<p>Players have a .StarterGear which holds items that they spawn with. So you could do;</p> <pre class='brush: lua'>local gamepassid_ = 10022825 local b = game:GetService("ServerStorage"):FindFirstChild("GravityCoil"):Clone() game.Players.PlayerAdded:Connect(function(player) if game:GetService("MarketplaceService")...
0
Loadstring not working even though loadstring is enabled?
140749926
mkhamster
58
2021-01-10 20:58:29
<p>My script uses a simple <code>loadstring("print('ae')")</code>, i can print out the string, but it won't do the loadstring</p> <p>My loadstring is enabled in server script service The loadstring code is in a server script</p> <p>loadstring() is not working for me, is there a new thing you have to add to it to run co...
118513
1
108417
1
58729054
Dovydas1118
1495
2021-01-10 21:18:17
<p>You will need to make a variable and then run the variable with brackets like this:</p> <pre class='brush: lua'>local runCode = loadstring("print('ae')") runCode() </pre> <p>Also make sure loadstring is enabled. It's a property of ServerScriptService.</p>
0
Help with :GetPlayerFromCharacter ?
46382260
SpazzMan502
133
2015-02-04 02:41:41
<p>So I'm trying to build off the the BloxyColaScript in most food gear to add hunger/thirst quenching properties.</p> <p>When I tried getting player from character (which I'm assuming is tool.parent) It comes with an error</p> <p><code>21:33:33.799 - GetPlayerFromCharacter is not a valid member of Model</code></p> <p>...
14733
2
17790
3
386992
BlueTaslem
18071
2015-02-04 02:46:23
<p><code>:GetPlayerFromCharacter</code> is a member of the <em>Players service</em>, not of models.</p> <p>Also note that you never defined the variable <code>character</code> but tried to use it.</p> <hr/> <p>Try</p> <pre class="brush: lua">local character = tool.Parent local player = game.Players:GetPlayerFromCharact...
1
Trying to make a part change a scrolling frames transparency to 1 when I touch it?
367143712
AltNature
169
2018-07-15 04:14:01
<p>So When I step on the part it does print yes and yet it doesn't change the transparency?</p> <p>local function onTouch(hit) game.StarterGui.ScreenGui.ScrollingFrame.BackgroundTransparency = 1 print("yes") end script.Parent.Touched:connect(onTouch)</p>
62776
1
How to make a script that will make all parts of a model be transparent ?
674740698
StouffYT
5
2019-12-24 10:56:57
<p>Hello Everyone , I have a problem i want to make a script that will make all parts of my model Named "TransparentWindows" be Transparent when i push a button. The button part is not problem but how do i get all the parts of a model in a script ?</p> <p>Thank you Forward.</p> <p>(Sorry there isnt a script because i c...
91854
0
?Assigning Player1, Player2, Player3 etc to 4 players in a game?
493019629
kag_e
12
2018-06-19 05:28:47
<p>Essentially when a Player is added to the game I want that Player to be assigned either P1, P2, P3 or P4 based on which ones are already taken. I have attempted this in several ways even though I could only think of a few. I will include an example of my code (doesn't work but will most likely help you understand my...
60683
0
Where Can I Check Who Bought My Developer Product?
92827605
OwOShiba
6
2020-06-29 16:39:47
<p>I'm trying to make a script that keeps track of who bought my developer product. I have this script, but I'm not sure where to see who bought it.</p> <pre class='brush: lua'>local MarketplaceService = game:GetService("MarketplaceService") local DataStoreService = game:GetService("DataStoreService") local Players = g...
107753
0
No Cursor Script?
53281459
DethFPSProject
5
2014-04-17 09:43:44
<p>I was recently wondering how in lets say Amnesia games on ROBLOX when they hold the lantern or something they only have a dot instead of the cursor on your screen, how do they do that does anyone know the whole script? or explanation??</p>
2407
2
3322
1
1449757
ZarsBranchkin
885
2014-04-17 09:56:36
<p>Mouse object has 'Icon' property. For some reason you cannot change it when you claim the mouse with</p> <p><code>localPlayer:GetMouse()</code></p> <p>method, so you must use a tool in order to change it. This is the sample script for tool, that would set your cursor to invisible:</p> <pre class='brush: lua'>script....
0
How would I make a Automatic Weapon?
34082258
Lineout
10
2014-03-01 20:21:55
<p>What would be the system I would have to do to make a gun automatic? I've done it before but totally forgot. If anyone of you could help I would be very happy :D</p>
405
1
717
1
64408300
RaverKiller
668
2014-03-01 21:22:42
<p>To create a automatic gun system, I would suggest use of a variable. Example:</p> <pre class="brush: lua">local Shooting = false while (Shooting) do Shoot() end </pre>
0
Difference between &quot;Game&quot; and &quot;game?&quot;
461604490
2Loos
145
2020-08-31 16:32:12
<p>What is the difference between "Game" and "game" in Lua? Apparently "Game" is deprecated. Does anyone know the history between "Game" and "game," and what is the difference? Thank you in advance, just wondering!</p> <pre class='brush: lua'>Game.Players.looloo314.leaderstats.Money.Value = 90000 </pre> <p>"Game" gets ...
112466
0
How to i pick a random object in workspace that isnt the table? In Roblox Studio
1364343395
Virsual_game
0
2021-02-16 15:30:09
<p>I'm trying to detect a new part in the workspace. but can seen to get it right. Players = Player WorkSpace = Game</p> <p>is more likely for anti-exploit so it cant place any object without the script knowing it!</p> <pre class='brush: lua'>local Items = {"Camera", "Tarrain", "Baseplate"} game.Player.PlayerAdded:...
120238
0
How do you stop a tool from falling on the floor after u equip it?
27806595
KenzaXI
166
2015-05-09 18:33:54
<p>Thanks for all your help, I finally figured it out. There is an instance called "weld" just needed to change my parts name to Handle and add wedge to the Tool. thanks for all you help</p>
17395
0
Why isn't Humanoid.MoveToFinished:Wait() working?
207797085
ErktikyYT
89
2022-04-03 19:55:35
<p><strong>Hello!</strong> So I've been bored and I've tried to make a basic Humanoid:MoveTo() script which disables player's controls when the player's character is spawning and when Humanoid.MoveToFinished event fires the controls are back with the player.</p> <p><strong>SCRIPT:</strong></p> <pre class='brush: lua'>g...
129542
0
Why does THIS happen?
14277028
rodrigo455
578
2016-05-31 16:46:51
<p>Hello! Today I'm here because of one issue: It bugs whenever I test on ROBLOX Studio! If I go to test and hit play, here is what happens: <a target="_blank" href="https://gyazo.com/3ab694b58aeb0c950f180bfb11adfbb1">Screenshot</a> If you could please tell me what's wrong and why this happens, I would thank you for so...
31160
0
ProximityPrompt Team object mover not working, any way to fix it?
728728511
NEMOTASTlC
1
2021-07-21 09:16:52
<p>I created a script that is supposed to do if you activate a Proximityprompt that it will move the model called "Lasers" in Workspace to Lighting if you are on the team called "Prisoners". The color of the team is "deep orange"</p> <p>Ive tried using a Remotevent to trigger it in Replicated storage,events. The Script...
125565
0
I'm trying to make this walkspeed script function properly can anyone fix it?
40621453
JerkDerekThe14alt
11
2022-05-01 23:33:39
<p>Can anyone help me with what I'm doing wrong?</p> <pre class='brush: lua'>local speed = 50 game.Players.PlayedAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if character:FindFirstChild("Humanoid") then character.WalkSpeed = speed else end ...
129885
1
117351
0
641077570
Scryptio
64
2022-05-02 00:35:05
<p>WalkSpeed is a property of Humanoid, not Character. Try this:</p> <pre class='brush: lua'>local speed = 50 game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if character:FindFirstChild("Humanoid") then character.Humanoid.WalkSpeed = speed ...
0
How to check if a Frame is a certain size ?
130785455
therealae
7
2017-12-24 21:16:52
<p>Im trying to check if 'Size' - a Frame on a surfaceGui - is bigger and smaller then a certain size</p> <p>necessary parts of script:</p> <pre class='brush: lua'>local Gui = v.DataPanel.OutsideData.Border local Power = Gui.Factor3Answer local PowerBar = Power.Tween local Size = PowerBar.Size if WaterPart.WaterQuantit...
50870
1
50671
0
4517264
UgOsMiLy
1074
2017-12-24 23:00:21
<p>The &lt; operator is used for numbers, and UDim is not a number. The way to check it is probably to look at the absolute size, multiply the X and Y axes of it to get the area, and compare</p> <p>To get the size needed on line 7 (scale), you need to get the screen size, which requires the mouse, so this needs to be p...
0
Make a Hold E or Press E system exploit proof?
83908862
blockmask
374
2022-08-22 00:49:04
<p>Hello, I'm making a input service type of system similar to Jailbreak. In my game, the player will hold E for a certain amount of seconds and it will change the brickcolor of a part.</p> <p>I have scripted all of this in a localscript <em>for now</em> as I'm unable to figure out a way to make this exploit proof. I a...
131315
1
118605
1
433962773
theking66hayday
841
2022-08-22 01:03:10
<p>Hi, I think it would be better if you post this question in the Roblox devforum. People there would most likely know how to make an exploit system</p>
0
Tool giver able to be exploited?
119219022
JustBenHD
2
2021-05-02 12:36:20
<p>I have a sword fight script where if they are in a certain area they get a sword and when they leave it removes. (by when the player touches the remove block) but i guess exploiters can bypass this with teleport so is there anyway i can fix it? If you need the script for it then just ask!</p>
123028
7
What does the tick function in ROBLOX do?
20342818
FrEeZeX
35
2014-02-20 16:13:11
<p>Um, so I've seen this in a couple of places and I'm wondering what exactly it does?</p>
166
0
Is there a way to check for something when a button is pressed?
342893559
SilentKiller5557
6
2022-05-08 19:23:54
<p>I would like to make it so that when a buttons is pressed, it does a different thing depending on a some boolValues.</p> <p>For example:</p> <pre class='brush: lua'>button.MouseButton1Click:Connect(function() if value.Value == true then </pre> <p>Something that essentially does that.</p>
129961
0
Linked sword invisible Kill Effect not working can someone help?
38670085
Nixlex
0
2022-08-06 09:37:51
<p>I am new to scripting and have attempted to make a kill effect for the linked sword. This is what I have come up with:</p> <pre class='brush: lua'>character:FindFirstChild("Humanoid").Health &lt;= 0 then script.Parent.Humanoid.Died:connect(function(Plr) for i, v in pairs(workspace:WaitForChild(sc...
131119
1
Does anyone know how to make this wok for Automatic Fire instead of Single Shot?
25240799
BearKranz
41
2014-09-17 12:35:27
<pre class="brush: lua">if (key == "f") then if (not isFiring) and (not cloakActive.Value) and (not shieldActive.Value) and (speed.Value &lt; fireSpeed) then isFiring = true fire() wait(weaponsCooldown) isFiring = false end end </pre> <p>Need it to mak...
10938
2
13828
1
14357591
Perci1
4988
2014-09-17 14:18:21
<p>I'm not entirely sure what system you have set up, but it's pretty easy to do. Just use a while loop to make yourself keep firing.</p> <pre class="brush: lua">local fire = false mouse.Button1Down:connect(function() fire = true end) mouse.Button1Up:connect(function() fire = false end) while fire do wait(0...
0
Storing color3 values in datastores?
6942109
FakeWhatWeDontKnow
0
2021-01-13 09:41:52
<p>This is my datastores script I use for various games, I want to do a customizable character system where you can change your colour schemes but the output keeps saying it can't save the color3 value and I figured you can't save regular C3 values so I wanted to see how I could go about that in the context of this scr...
118635
0
Global Variables, how do they work?
1684846
Necrorave
560
2014-07-15 03:09:29
<p>I am attempting to have one script with a boolean variable determine if another script should run.</p> <p>I seem to be having trouble getting the variable to transfer over though.</p> <p>This is a basic summary of what I am trying to do. (Rather than throwing my entire block of code at you)</p> <p>Script 1:</p> <pr...
8132
1
10573
4
15049169
DragonSkyye
517
2014-07-15 03:24:33
<p>Say you have <code>_G.Var = true</code> in the server-script <strong>'apple'</strong> then you have another server-script called <strong>'Bananas'</strong> you can access <code>_G.Var</code> from Bananas since it is <code>Global</code></p> <p>In Apples</p> <pre class='brush: lua'>_G.Var = true </pre> <p>In Bananas</...
0
How can I prevent repeated values using math.random?
1406209964
ElectricZooo
55
2020-05-01 21:15:15
<pre class='brush: lua'>function generateMedKit(name) local MedKits = game.ServerStorage.MedKits:FindFirstChild(name) local Cords = {"5, 5, 5","10, 10, 10","20, 20, 20","40, 40, 40","80, 80, 80"} local randNum = math.random(1,#Cords) local chosenValue = Cords[randNum] print(chosenValue) ...
101514
2
93782
0
44083134
Fifkee
2017
2020-05-01 21:24:47
<p>You don't. It's psuedorandom, you're bound to get the same values over and over again the smaller the range.</p> <p>However, you can attempt to manipulate by setting the randomseed, using a combination of both math.random and the Random library, or just by simply creating your own random function.</p>
1
What is this line in parentheses do when a remote event is fired?
102782207
JadensLua
12
2020-08-21 05:48:55
<p>I'm very confused, I saw this in a script I'm looking in and I want to know what it does and how the remote event script knows what it does. Any clarification would be appreciated, thanks! This is the code by the way.</p> <pre class='brush: lua'>local Event = Instance.new("RemoteEvent") Event:FireServer("Potato") </...
111811
1
102665
1
134745532
zane21225
203
2020-08-21 05:58:10
<p>The parenthesis is used to transfer information from one side of the event to another.</p> <p>For example:</p> <p>script 1 (fires the event)</p> <pre class='brush: lua'>local Event = game.ServerStorage:WaitForChild('RemoteEvent') Event:FireServer('Hello!') </pre> <p>script 2 (receives the event)</p> <pre class='brus...
1
Can't find a way to get the character from the player?
835155757
BRO_ITmeYO
120
2020-06-05 19:28:01
<p>this is my code but I keep getting this error: ServerScriptService.Script:5: attempt to index nil with 'Character'</p> <pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(player) print(player.name "joined") end) if not player.Character then print("waiting for character") player.CharacterAdd...
105457
1
97167
2
101568031
Defectivethekiller1
72
2020-06-05 19:40:23
<p>put your if statement inside the function. Your if statement does not know what player is because the player is a parameter of the function and it is only available for code inside the function (someone please explain this better).</p>
0
Player help and any QUI tips?
34322357
RedBerryPanda
0
2014-04-15 08:34:36
<p>I've been trying to find an answer for this for some time now, but failed. I've made a backpack that i would like players to wear when they enter my game. Is there any way i can make that possible?</p> <p>And can someone give me some tips on QUIs? I would like to make the backpack useful.</p>
1571
0
How do I give a specific player coins not everyday while having data store?
676326715
WINDOWS10XPRO
134
2021-01-14 03:45:37
<p>So I have data store because I'm making a simulator game, the thing is, I want to give my player coins because he helped me so much! And I suddenly realised that I have data store, so how do I do it? his name is aimanlovemalaysia683, Nobiszx and Riziien.</p>
118667
0
attempt to call field 'Text' (a string value) error?
102254161
squidiskool
200
2019-12-07 23:10:24
<p>So, I am trying to make a textbox if where you put 0.9, it will put the car's height like a lowrider. But it is not changing and gives me this error: 18:05:06.931 - Players.squidiskool.PlayerGui.ScreenGui.TextBox.Script:1: attempt to call field 'Text' (a string value)</p> <p>Here is the code if you want to look furt...
91096
4
84366
0
1307571071
jensar141215
157
2019-12-07 23:43:33
<p>Hey, so this should work.</p> <pre class='brush: lua'>local Box = script.Parent Box.FocusLost:Connect(function(enterPressed) if enterPressed then print("Input recieved") end local Number = ("0.9") if Box.Text == (Number) then print("Input is equal to number") --Add your stuff here end end) </pre> <p>Make a local...
0
Roblox Studio Crashing Consistently?
58556863
Wolf5429
15
2021-01-12 23:30:10
<p>I know this site is generally for coding help but I've been having a very frustrating issue with Studio itself and would really like some help troubleshooting.</p> <p>For the past 3 days now, I will load up Studio and it will just randomly crash after about 5-10 minutes. It seems like it crashes mainly when selectin...
118612
1
Workspace.SCPTELEPORTS.087-B.tele2.Script:13: attempt to index boolean with 'Clone' ? server script
235251315
Wrathoxicihatehim
5
2022-09-15 12:43:23
<pre class='brush: lua'><br /></pre> <p>Ready = true function onTouch(part) if Ready == true then Ready = false script.Parent.Parent.tele1:remove() script.Parent.BrickColor = BrickColor.new("Really red") local humanoid = part.Parent:findFirstChild("Humanoid") if(humanoid ~= nil)then humanoid.Parent["Body Colors"]:Destr...
131627
1
How to do this when you step on a part you get a thing?
967797003
ltbyks12
16
2021-04-06 12:45:46
<p>please tell im stupid local function onTouch(Part) print("Touch started: " .. Part.Name) numTouchingParts = numTouchingParts + 1 tl.Text = numTouchingParts end</p> <p>local function onTouchEnded(Part) print("Touch ended: " .. Part.Name) numTouchingParts = numTouchingParts - 1 tl.Text = numTouchingParts end</p> <p>Pa...
122068
1
111196
0
397300457
Ponytails2017
43
2021-04-06 12:57:14
<p>Next time use a code block.</p> <p>Put your tool in ReplicatedStorage.</p> <pre class='brush: lua'>local tool = ReplicatedStorage.Tool script.Parent.Touched:Connect(function() tool.Clone(). Parent = player.Backpack end </pre> <p>Make sure to find the player as I can't do everything for you. I hope this helps. :)...
2
Whats the difference between Mouse.Hit &amp; Mouse.Target?
1707962
yurhomi10
192
2014-04-18 18:25:24
<p>Having trouble understaning the differences between these two.</p>
2721
2
3778
8
386992
BlueTaslem
18046
2014-04-18 18:27:59
<p><code>mouse.Hit</code> refers to the <em>position</em> that the mouse was touching. <code>mouse.Target</code> refers to the <em>part</em> that the mouse was hovering on.</p> <p>While for many things <code>mouse.Target.Position</code> will be pretty close to <code>mouse.Hit.p</code> they are <em>not</em> the same pos...
0
Fire Upon Touching?
24056470
Vescatur
95
2014-05-17 23:23:21
<p>I know this is probably a simple question, but I can't seem to figure it out. Essentially, I want your character to "catch fire" when you step on a fire. I know how to do the damage over time and all that stuff, but what I'm wondering is how to create a fire on the character's torso. Any help with this would be very...
5010
0
how to make part follow me im trying to make pet ?
1532403038
MONSTERGAMES3609
14
2021-01-05 11:08:30
<p>i dont know what is the problem in my script this is the script</p> <pre class='brush: lua'>game.Players.PlayerAdded:Connect(function(Player) local character = Player.Character local humRootPart = character.HumanoidRootPart local FirePet = game.ServerStorage.Pets.FirePet local bodyPos = game.ServerStorage.Pets.FireP...
118215
0
What is wrong with this script?
43561529
BritishGotSwag
30
2014-05-07 00:12:39
<pre class='brush: lua'>local debounce = false function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end -- The error was on this line end return nil end function onTouch(part) local human = part.Parent:findFirstCh...
4451
0
How do I add Vector3 to Region3?
1507353142
Bloxyses
57
2022-10-03 23:33:13
<p>I'm working on a game where random disasters are generated through a module script, and I'm currently making a flood. However, since the touch event isn't quite the best for this, I am considering region3. I want to make the size of the region3 rise every 2 seconds, however, I can't seem to add a Vector3 to the Regi...
131793
0
Clearing texture memory upon removing a model?
29622
callmehbob
54
2017-09-30 22:01:46
<p>I notice when a model is removed from the workspace that contains textures, or a gui is no longer visible that also contains decals/textures, roblox doesn't delete the data for them although not in use/removed. I don't even know if this is possible, hence no script, I was reading in the wiki about "good practices" r...
48280
0
How do I make a GUI appear when a player is sitting on a seat?
999502939
Dragonboy99711
5
2020-06-07 08:11:20
<p>I want to make a script when someone sits on a seat a GUI will appear, how do I do that?</p>
105616
2
97289
0
297686735
Friskyman321
121
2020-06-07 08:36:40
<p>hi</p> <pre class='brush: lua'>plr = game.Players.LocalPlayer char = plr.Character or plr.CharacterAdded:Wait() if char.Humanoid.Sit == true then urGui.Enabled = true end </pre>
0
How to use &quot;for i, v in pairs&quot;?
50338286
WolfgangVonPrinz
0
2015-05-08 19:37:47
<p>I'm a below average but new scripter, could someone be kind enough to explain how to use for i, v in pairs? I found no decant tutorials for this. I know you can do something like this</p> <p>script.Parent.Parent:GetChildren() for i, v in pairs</p> <p>or something along those lines, and it'll change an entire models ...
17366
0
Why is my Script Isn't showing my icon above me head?[CLOSED]
17238315
littledamian55
0
2014-05-09 00:35:51
<p>this don't show my icon i made over my head</p> <pre class='brush: lua'>-- Made by Hyper_Tech game.Players.PlayerAdded:connect(onPlayerRespawned) function onPlayerRespawned(newPlayer) wait(1) if newPlayer ==("littledamian55") then gui=Instance.new("BillboardGui") gui.Parent=newPlayer.Characte...
4550
1
How can I smooth move a model?
73884919
MineJulRBX
52
2017-06-12 15:31:11
<p>I have a little airport. I like a airplane to drive or move around there. I tried:</p> <pre class="brush: lua">for i = 1,500 do Airplane.Position = Airplane.Position + Vector3.new(0,0,5) wait(0.01) end </pre> <p>&amp; a tutorial by Roblox using BodyPosition</p> <p>But these only works with parts/unions for m...
43943
1
45181
2
1792206
nicemike40
486
2017-06-12 20:01:39
<p>Use CFrame instead of position, and use the Set/GetPrimaryPartCFrame method available to models:</p> <pre class="brush: lua">local speed = 0.05 -- You want a number much lower than 5 studs because you move it 30 times every second! for i = 1, 500 do local currentCFrame = Airplane:GetPrimaryPartCFrame() Airpl...
0
Is there a script that can spawn models?
770868
Wheel326
0
2014-06-01 13:59:32
<p>When you click a button/part, it should activate a script. So when it's clicked, a model should appear/spawn in a specific spot. Is there a script that does that?</p> <p>EDIT:</p> <p>I don't know much about scripting, I know there is ClickDetector, but is there a script something less complicated? Also, another scri...
5984
3
7954
1
13650732
Tesouro
407
2014-06-01 14:14:07
<pre class='brush: lua'>newmodel = game:GetService("InsertService"):LoadAsset(ModelAssetID) newmodel:MoveTo(Vector3.new(0, 0, 0)) </pre>
0
Anything that can record a player's movements?
25516360
Zerio920
285
2014-12-06 01:35:28
<p>Is there any service or event I can use that can record what actions a player does, like jumping, turning left, moving up, etc.?</p>
13010
1
16057
3
413000
Mr_Octree
101
2014-12-06 01:56:51
<p>Perhaps. You could make a value that is increased every time a player jumps; for example</p> <pre class="brush: lua">local player = game:GetService("Players").LocalPlayer local char = player.Character local jumped = 0 local jumpval = Instance.new("NumberValue",script) jumpval.Name = "JumpValue" print(jumped) while t...
2
How do you make a jump cooldown/delay?
109973606
OddExistent
52
2020-04-07 02:10:58
<p>Hello! How can you make it so that you only jump once until you release the jump button and at the same time have a cool down? I have no idea how that would work</p>
98365
3
90877
1
1348670747
Utter_Incompetence
836
2020-04-07 02:22:05
<pre class='brush: lua'>local us = game:GetService("UserInputService") local canJump = true us.JumpRequest:Connect(function() if canJump then canJump = false game.Players.LocalPlayer.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false) wait(2) canJump = true game...
0
Assign only one player to a certain team?
120574566
LazerShatters
314
2020-05-30 13:26:08
<p>So I have a script that would randomly assign players to teams:</p> <pre class='brush: lua'>local team1 = game.Teams.Yellow local team2 = game.Teams.Blue for _, player in pairs(game.Players:GetPlayers()) do math.randomseed(tick()) local team = math.random(1,2) if team == 1 then ...
104834
1
96677
1
87736336
exxtremestuffs
345
2020-05-30 13:35:09
<p>The easiest solution would be to assign everyone to the other teams, then select the person for the single team.</p> <p>The complicated solution would be to create an array of valid players to be assigned teams, like:</p> <pre class='brush: lua'>local others = Players:GetPlayers() local single = table.remove(others,...
1
How to fix error Infinite yield possible on 'Workspace.:WaitForChild(&quot;Humanoid&quot;)?
310835382
MPforfun
89
2019-05-12 02:41:39
<p>i have a sword script and it will stop working and this will show up in the output 21:40:31.563 - Infinite yield possible on 'Workspace.:WaitForChild("Humanoid")' im not sure how to fix it but here is the script</p> <pre class="brush: lua">local Obj = script.Parent local Debounce = true Obj.Touched:connect(function(...
80152
1
75349
1
514615548
ClouZek
16
2019-05-30 16:33:49
<pre class='brush: lua'>1 local Obj = script.Parent 02 03 local Debounce = true 04 05 Obj.Touched:connect(function(Hit) 06 if Debounce == true then 07 Debounce = false 08 wait() 09 if Hit.Parent:FindFirstChild("Humanoid") then 10 Hit.Parent.Humanoid.Health = Hit.Paren...
0
I've tried to use &quot;if&quot; to detect another image but it doesn't work. How do you do it correctly?
1590947862
Stikeys
0
2020-11-21 23:12:01
<pre class='brush: lua'>if game.StarterGui.LoadingGui.LoadingImage.Visible = false then &lt;-- this line here script.Parent.TextTransparency = 0.1 wait(0.5) script.Parent.TextTransparency = 0.2 wait(0.5) script.Parent.TextTransparency = 0.3 wait(0.5) script.Parent.TextTransparency = 0.4 ...
116127
0
Having trouble removing a function from a script?
71359034
freshieman
0
2014-11-28 23:46:27
<p>I'm trying to script a spitfire aircraft. I've taken a script and a few things from a seat that changes the plane's rotation (rotates it up/down so it can climb and descend, like a real airplane) and then combined them with a script that makes the plane go forward and reverse. Whatever I have tried, has not worked. ...
12835
0
How do I make it where when I kill something a key drops and it opens a door?
159636940
RareBIue
133
2020-06-05 01:12:18
<p>So I’m making a game where when you start a demon spawns and you have to kill it then when you kill it a key drops and you can use that key to open a door then move on. Does anybody have a clue on how I can do that?</p>
105389
3
97116
0
89887998
RGRage
45
2020-06-05 01:53:38
<p>Working off what BRO_ITmeYO proposed, his code required a loop in order to check instances for the death of the demon which is not ideal. A better solution would be to use the function Died for the humanoid class and then destroy the demon so that there is no position conflicts. Also a clone of the original key woul...
0
How do I make the animation in my Shift To Crawl script play and stop instantly?
554648856
Lemonade9782
4
2022-09-16 16:18:47
<pre class='brush: lua'>local char = script.Parent local hum = char:WaitForChild("Humanoid") local animator = hum:WaitForChild("Animator") local animate = char:WaitForChild("Animate") local ui = game:GetService("UserInputService") local crawlin = false ui.InputBegan:Connect(function(input) if input.KeyCode == Enum....
131641
1
118890
0
1929477313
Kingu_Criminal
111
2022-09-16 21:14:26
<p>Changing the animate script of the character itself is really bad, simply play an animation over them (higher priority) Use input</p> <pre class='brush: lua'>local uis = game:GetService("UserInputService) local function CheckKeyDown() --check key down end local function CheckKeyUp() --check key up end uis.In...
0
How do you Insert a Script with HttpService
1144900
DeveloperAtWork
14
2014-02-20 01:15:23
<p>I mean like PasteBin Source so i want to get the PasteBin code i put there to go into a Script on ROBLOX</p>
145
3
281
3
18390582
ElectricBlaze
30
2014-02-20 01:39:52
<p>For Pastebin, it's actually quite simple. Every paste you create on Pastebin is also given a webpage purely for its raw paste data. For instance, I just created a paste that says</p> <pre class='brush: lua'>print("Hello, World!") </pre> <p>(You can find it <a target="_blank" href="https://pastebin.com/XahrgvKq">here...
1
Part falls through everything?
430231091
FireManiac6
5
2022-08-01 15:35:45
<p>Hey. There might be a very simple solution for this but I just want to know how to make my part not phase through everything when CanCollide set to false? (parts, baseplate, just falls down to void)</p>
131042
0
Tween won't work and has no errors?
538824226
Brioche_Noodle
45
2022-08-02 12:25:25
<p>My Door Tween Is not opening when it functions, I have no errors!</p> <p>There is a left door and a right door and both of them are unanchored but they both have a weld attachment that welds to a primary part</p> <p>My code</p> <pre class='brush: lua'>local this = script.Parent local TweenService = game:GetService("...
131060
1
How to find if an value exists as in a lua table?
61581073
Igoralexeymarengobr
365
2019-06-03 20:26:36
<p>I would like to know how can a script find if a value exists in a Lua table, something like</p> <pre class='brush: lua'>luatable = {"abc", "cba", "bab"} --example: wanted to know if something in workspace with a name of any of those values exists.. </pre> <p>How can I do it?</p>
81146
1
75519
1
266723646
AIetheo
236
2019-06-03 20:30:36
<p>You Could Use A For Loop To Search Through The Descendants Of Workspace Or Whatever Your Looking For</p> <p>Example</p> <pre class='brush: lua'>local Table = {"abc","bca","cab"} for i,v in pairs(workspace:GetDescendants()) do -- Will Go Through Everything in the workspace if Table[v.Name] then -- If the name of ...
0
Calling a function returns an error?
310696583
LeHelary
87
2020-03-23 10:57:32
<p>I am creating a script to prevent players from teleporting to long distances. There are many functions, but when I try to call this specific one, all functions return an error "attempt to call global &lt;FunctionName> (a nil value)". I tried to copy and paste the function in another script and it still gives the sam...
96807
0
How do you refer something if it has a space in it?
365389855
kindjamon
0
2018-10-26 23:22:33
<p>I have been trying to make a script that locally removes an object if they meet the requirements.</p> <p>I've been having problems with referring to something in "Workspace"</p> <p>Here's what I've already done:</p> <p><code>game.Workspace.ObjectHere</code></p> <p>This is what I need to do</p> <p><code>game.Workspac...
69521
2
LockFirstPerson - How do i correctly do it?
14451219
Cataclyzmic
93
2014-02-25 20:12:30
<p>I have this script, that's inside of a button.</p> <pre class="brush: lua">function onClicked() script.Parent.Parent.Parent:remove() print("everything removed") game.Players.LocalPlayer.CameraMode = "LockFirstPerson" print("FirstPersonisLocked") end script.Parent.MouseButton1Click:connect(onClicked) </pre> <p>When i...
297
1
543
2
64408300
RaverKiller
668
2014-02-25 20:29:05
<pre class="brush: lua">script.Parent.MouseButton1Click:connect(function() -- Improved with anonymous function game:GetService("Players").LocalPlayer.CameraMode = "LockFirstPerson" script.Parent.Parent.Parent:Destroy() print("First person is now locked.") end) </pre> <p>I have tested the above in-game and i...
0
My script gives me an error. Why does it not work? (Check bottom for more info)
1044877460
MariamOMG090
9
2023-02-18 18:55:26
<p>This script is supposed to check if a player is on red team then if the player is on red team and touches a part then it will kill that player. but when I run the script and test it, it gives me this error: attempt to index nil with 'Team' - Server - RedTeamTouched:8</p> <pre class="brush: lua">local Team = game:Get...
133089
3
120184
0
559514967
T3_MasterGamer
2189
2023-02-19 08:01:13
<p>I'm assuming you're using a server script (normal script). Unlike local scripts, <code>Players.LocalPlayer</code> doesn't exist and will return <code>nil</code>. If you want to get the <a target="_blank" href="https://create.roblox.com/docs/reference/engine/classes/Player"><code>Player</code></a> object from <code>h...
0
How do you make a transition when you teleport?
1389886885
ILikeBaked_Beans
12
2021-04-29 20:25:23
<p>I'm trying to make a part that teleports you to another room but i don't know how to make a transition screen.</p> <pre class='brush: lua'>local transitionGUI = game.StarterGui.ScreenGUI.Frame local ProximityPrompt = script.Parent ProximityPrompt.Triggered:Connect(function(player) transitionGUI.BackgroundTranspa...
122943
0
How to detect when a player has touched terrain(Water)?
124281858
DeceptiveCaster
3761
2018-04-17 14:53:21
<p>I have a timer Gui for my Ninja Warrior game, and here are the components:</p> <ul> <li><p>A Part called Start to start the timer</p></li> <li><p>A Part called ClearButton to finish the course and disable the timer(overlap debug)</p></li> <li><p>A Part called Reset to reset the timer Gui and enable it for Start to b...
56994
4
55696
0
15976036
AnAnonymousDeveloper
77
2018-04-17 15:56:36
<pre class='brush: lua'>if hit:IsA("Terrain") then </pre> <p>sorta thing</p> <p>But for water you replace Terrain with "Water"</p>
0
How to detect the player's name when a gui has been clicked?
412955334
AriyanHacker29
18
2020-08-02 12:40:04
<p>I wanted to know whether it is possible to detect the name of the player after he/she clicked on a text button. The player will die when the gui he clicked is wrong so i want to detect what he/she pressed. Thanks in advance!!</p>
110536
2
101543
0
87736336
exxtremestuffs
310
2020-08-02 16:04:54
<p>Since you have to manage UI on the client, you can easily just get the local player using <code>game:GetService("Players").LocalPlayer</code>, and the name is just <code>LocalPlayer.Name</code>. Hope this helped!</p>
0
The else statement wont run?
1347908937
InspireWithFun
7
2021-04-06 05:27:13
<pre class='brush: lua'>local Damage = game.ReplicatedStorage.Guns.Colt.Damage.Value local Ammo = game.ReplicatedStorage.Guns.Colt.Ammo.Value local MaxAmmo = game.ReplicatedStorage.Guns.Colt.MaxAmmo.Value local AmmoReloadTime = game.ReplicatedStorage.Guns.Colt.ReloadTime.Value local Player = game.Players.LocalPlayer lo...
122059
2
111186
0
1298932301
ellxiac
78
2021-04-06 05:39:09
<p>You should check if the player has more than 0 ammo, so you would need to use ">" instead of "~=" in line 14.</p>
1
Add a selectionbox
53374414
StoleObamasKfc
10
2014-03-10 20:58:19
<p>How can I add a selectionbox to whatever touches a brick?</p> <pre class="brush: lua">function onTouched(hit). Instance.new("SelectionBox").Parent = hit end script.Parent.Touched:connect(onTouched) </pre>
614
2
969
7
35339312
ImageLabel
1541
2014-03-10 21:01:39
<p>What part?</p> <pre class="brush: lua">workspace.Part.Touched:connect(function(hit) c = Instance.new("SelectionBox", hit) c.Adornee = hit end) </pre> <p>Also, You've got to set the Adornee.</p>
0
Detect if a key is being held then let go (keydown?)
50582311
V_ChampionSSR
247
2016-10-15 21:45:35
<p>I've tried it many ways but I couldn't figure out how. I'm trying to do this with UserInputService but i've had no luck. I can make it so that if a key is pressed, something functions but i can't seem to figure out how to detect if a key is not being held anymore</p> <p>If anybody could help me out that would be gre...
36362
0
How do I make this tool select the part that the player clicked on?
102254161
squidiskool
185
2021-02-21 01:09:25
<p>Hello, I'm making btools. I'm wondering how do you get the part that the player clicked on? I want it so that when you click on the part, a decal appears on the part you clicked.</p> <pre class='brush: lua'>local tool = script.Parent local function Texture2D(point) local Texture2D = Instance.new("Decal") Tex...
120442
0
why are no scripts working inside my projectiles?
1865523181
pakancina
19
2023-02-28 16:49:58
<pre class='brush: lua'>local Tear = game.ReplicatedStorage:WaitForChild("tear") local plr = game.Players.LocalPlayer local UserInputService = game:GetService("UserInputService") local speed = 110 UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if not gameProcessedEvent then -- if player is ...
133132