|
| 15 Feb 2015 07:54 PM |
i have a script thats in a gui in startergui to make the gui load after 15 seconds
wait(15) script.Parent.Background.Visible = true
how can i make it so when the gui shows, they character walkspeed goes to 0 |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2015 07:56 PM |
wait(15) script.Parent.Background.Visible = true game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
Eh, that code is really ugly in my opinion. But if the task is that simple, and there's 15 seconds for everything to load, I guess it won't make a major difference.
Also this should be a LocalScript. |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2015 08:03 PM |
| its just for a simple task, let player enter game and fully load, then freeze them after 15 seconds to load a gui and other game features |
|
|
| Report Abuse |
|
|
|
| 15 Feb 2015 08:25 PM |
@diamond
might want to add in some checks for stuff
if any thing along those lines doesnt exist (the character, humanoid, etc.) then it will break
since this is for a game u might want to make sure that the character and humanoid actually exist before executing that line |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:41 AM |
i can add the check myself i just completely forgot about localplayer its only a snip from part of a script i have made, didnt want to post my whole code here |
|
|
| Report Abuse |
|
|
|
| 16 Feb 2015 09:51 AM |
i believe this is the correct check
if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") ~= nil then script.Parent.Background.Visible=true game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0 end |
|
|
| Report Abuse |
|
|