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
 

Re: Run Tool isn't working

Previous Thread :: Next Thread 
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:17 PM
It's a normal tool in StarterPack.


function OnClicked()
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 25
wait(10)
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
end

script.Parent.MouseButton1Click:connect(onClicked)
Report Abuse
yoshiegg6 is not online. yoshiegg6
Joined: 20 Jul 2012
Total Posts: 3191
17 Apr 2014 04:19 PM
Don't forget to add debounce so it isn't spam-able. But, I don't know why its not working.
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 04:20 PM


its .Activated not .MouseButton1Click
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:25 PM
Still doesn't work:

function OnClicked()
debounce=true
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 25
wait(10)
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
end

script.Parent.Activated:connect(onClicked)
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 04:26 PM
debounce = false

function OnClicked()
if debounce == false then
debounce=true
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 25
wait(10)
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
debounce = false
end
end
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:32 PM
That doesn't work either.

Is it supposed to be in a normal script or a localscript?
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
17 Apr 2014 04:32 PM
Normal script.
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:35 PM
All right, it is. It still doesn't work.
Again, this is a normal script inside a normal tool inside StarterPack.
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 04:35 PM
sigh, localscript in a tool.

function OnClicked()
if debounce == false then
debounce = true
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 25
wait(10)
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 16
debounce = false
end
end

script.Parent.Activated:connect(OnClicked)
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:42 PM
Still doesn't work..
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
17 Apr 2014 04:42 PM
Debounce isn't defined.

#nerdsunited
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 04:43 PM
I defined it in the other, yet you decide its great to delete it.

debounce = false
function OnClicked()
if debounce == false then
debounce = true
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 25
wait(10)
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 16
debounce = false
end
end

script.Parent.Activated:connect(OnClicked)
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
17 Apr 2014 04:44 PM
You deleted it...

"function OnClicked()
if debounce == false then
debounce = true
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 25
wait(10)
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 16
debounce = false
end
end

script.Parent.Activated:connect(OnClicked) "

this was YOUR post.

#nerdsunited
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 04:45 PM
Because I copy/pasted his >_>
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:46 PM
It works! Thanks.
Report Abuse
LordDeofol is not online. LordDeofol
Joined: 29 May 2010
Total Posts: 614
17 Apr 2014 04:47 PM
Sensei's works, I mean.
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
17 Apr 2014 04:47 PM
If your trying to get it to run when clicked, than Activated is need to get the mouse for the Button1Down event.

running = false

script.Parent.Activated:connect(function(mouse)
mouse.Button1Down:connect(function()
if not running then
running = true
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
wait(10)
game.Players.LocalPLayer.Character.Humanoid.WalkSpeed = 16
running = false
end
end)
end)
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
17 Apr 2014 04:49 PM
local db = false
local runtime = 10 --Change if needed.

script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
if db == true then return end
db = true
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
wait(runtime)
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
end)
mouse.Button1Up:connect(function()
if db == true then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
db = false
end)

script.Parent.Unequipped:connect(function()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
db = false
end)

When life gives you lemons... BURN HIS HOUSE DOWN! >:D
Report Abuse
SenseiWarrior is not online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
17 Apr 2014 04:49 PM
Did you guys not see him say that it worked, thread is dead.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
17 Apr 2014 04:52 PM
@Sensei I did not... I keep getting ninja'd today... :(

When life gives you lemons... BURN HIS HOUSE DOWN! >:D
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