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 » Scripting Helpers
Home Search
 

Script timing broken

Previous Thread :: Next Thread 
boneman529 is not online. boneman529
Joined: 21 Mar 2010
Total Posts: 392
23 Oct 2014 02:45 AM
So basically what im trying to do is get it so that you can't move until 5 seconds is over and it makes ur speed 11



speed = 0

function onPlayerEntered(Player)
if Player.Character == nil then
repeat wait() until Player.Character ~= nil
x = Player.Character:findFirstChild("Humanoid")
x.WalkSpeed = speed
if Player.Character == nil then
repeat wait()until Player.Character ~=nil
x = Player.Character:findFirstChild("Humanoid")
wait(5)
x.Walkspeed = 11
end
end
end

game.Players.ChildAdded:connect(onPlayerEntered)









It sets my speed to 0 but doesn't make it 11
Report Abuse
Vulnerite is not online. Vulnerite
Joined: 05 Nov 2007
Total Posts: 11492
23 Oct 2014 03:10 AM
speed = 0

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
local hum = char.Humanoid
hum.WalkSpeed = speed
delay(5, function() speed = 11 end)
end)
end)
Report Abuse
Vulnerite is not online. Vulnerite
Joined: 05 Nov 2007
Total Posts: 11492
23 Oct 2014 03:11 AM
oops
missed a line


game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
local hum = char.Humanoid
hum.WalkSpeed = speed
delay(5, function() speed = 11 end)
hum.WalkSpeed = speed
end)
end)
Report Abuse
boneman529 is not online. boneman529
Joined: 21 Mar 2010
Total Posts: 392
23 Oct 2014 07:37 AM
Still stuck and won't go to 11 walkspeed =/

Tried editing yours but still doesn't work for me
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
23 Oct 2014 08:47 AM
x.Walkspeed = 11

Not sure whether it matters or not, but I've noticed you haven't capitalized the 'S' in speed, but you have for the one prior to that.
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
23 Oct 2014 08:52 AM
speed = 0

function onPlayerEntered(Player)
if Player.Character == nil then
repeat wait() until Player.Character ~= nil
x = Player.Character:findFirstChild("Humanoid")
x.WalkSpeed = speed
if Player.Character == nil then
repeat wait() until Player.Character ~= nil
x = Player.Character:findFirstChild("Humanoid")
wait(5)
x.WalkSpeed = 11
end
end
end

game.Players.ChildAdded:connect(onPlayerEntered)

Doesn't look like much has been changed, but just try it.
Report Abuse
boneman529 is not online. boneman529
Joined: 21 Mar 2010
Total Posts: 392
23 Oct 2014 09:06 AM
Thanks but I just like combinded two scripts and now this works


idk but yea


game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
local hum = char.Humanoid
hum.WalkSpeed = speed
delay(5, function() speed = 0 end)
hum.WalkSpeed = speed
end)
end)
function onPlayerEntered(newPlayer)
wait(20)
newPlayer.Character.Humanoid.WalkSpeed = 9
end

game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
thermonuklear is not online. thermonuklear
Joined: 19 Oct 2014
Total Posts: 484
23 Oct 2014 08:53 PM
game.Players.PlayerAdded:connect(function(Player)
local Humanoid = Player.Character.Humanoid
Humanoid.WalkSpeed = 0
wait(5)
Humanoid.WalkSpeed = 11
end)

It's simple.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Oct 2014 08:58 PM
That's not going to work. Their Character won't exist right when they join. Use CharacterAdded
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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