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
 

Run/Wait

Previous Thread :: Next Thread 
NarutoBrokenBond is not online. NarutoBrokenBond
Joined: 12 Jul 2013
Total Posts: 96
24 Jul 2013 09:29 PM
function click()
while true do
plyr = script.Parent.Parent.Parent.Parent.Parent.Character
plyr.Humanoid.WalkSpeed = 30
c = script.Parent.Parent.Chakra
wait(2)
c.Value.Value = c.Value.Value - 5
if c.Value.Value == 0 then
plyr.Humanoid.WalkSpeed = 16

end
end
end

script.Parent.MouseButton1Click:connect(click)

Thats to make the character run. But when it gets to 0, how can I make it stop going down?
==================================================================
WALKING

function click()
plyr = script.Parent.Parent.Parent.Parent.Parent.Character
plyr.Humanoid.WalkSpeed = 16
script.Parent.Parent.Run.Script.Disabled = true
end
script.Parent.MouseButton1Click:connect(click)



BTW theres 2 scripts in Run
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
24 Jul 2013 09:31 PM
Try this out

http://wiki.roblox.com/index.php/Break#Break
Report Abuse
MisterEpicSpaghetti is not online. MisterEpicSpaghetti
Joined: 20 Jul 2013
Total Posts: 123
24 Jul 2013 09:43 PM
function click()
while true do
plyr = script.Parent.Parent.Parent.Parent.Parent.Character
plyr.Humanoid.WalkSpeed = 30
c = script.Parent.Parent.Chakra
wait(2)
c.Value.Value = c.Value.Value - 5
if c.Value.Value == 0 then
plyr.Humanoid.WalkSpeed = 16

end
end
end


I would suggest this o3o

running = false
C = script.Parent.Parent.Chakra
Character = game.Players.LocalPlayer:getPlayerFromCharacter()


script.Parent.Selected:connect(function(mouse)
mouse.Button1Down:connect(function()
running = true
end)
mouse.Button1Up:connect(function()
running = false
end)
end)


while running do
for i=Chakra.Value.Value, 0, -5 do
wait(2)
Character:findFirstChild("Humanoid").Walkspeed = 30
end
Character:findFirstChild("Humanoid").Walkspeed = 16
end



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