generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: need help with a script for walkspeed

Previous Thread :: Next Thread 
RevolutionXPK is not online. RevolutionXPK
Joined: 28 Oct 2011
Total Posts: 785
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
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
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
RevolutionXPK is not online. RevolutionXPK
Joined: 28 Oct 2011
Total Posts: 785
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
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
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
RevolutionXPK is not online. RevolutionXPK
Joined: 28 Oct 2011
Total Posts: 785
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
RevolutionXPK is not online. RevolutionXPK
Joined: 28 Oct 2011
Total Posts: 785
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image