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: Walkspeed Powerup Script Help

Previous Thread :: Next Thread 
FriendlyLOLpwnzr is not online. FriendlyLOLpwnzr
Joined: 12 Sep 2011
Total Posts: 9320
17 Jul 2013 03:25 PM
I made a script to increase a user's walkspeed to 32, thenwait for 10 seconds to reset the user's walkspeed back to 16.

--------------------------------------------------------------------------------------------------------------------

function onTouched()
script.Parent.Parent.Parent.Workspace.Character.Humanoid.WalkSpeed = 32
script.Parent.BrickColor = BrickColor.new("Medium stone grey")
script.Parent.Transparency = 0.5
wait(10)
script.Parent.Parent.Parent.Workspace.Character.Humanoid.WalkSpeed = 16
script.Parent.BrickColor = BrickColor.new("Neon orange")
script.Parent.Transparency = 0
end

script.Parent.Touched:connect(onTouched)

--------------------------------------------------------------------------------------------------------------------


The script did not perform at all after I touched it, and I did not find any error messages in the output when I tested in solo mode. If somebody could tell me how to fix the script, that would help me a lot. In addition to helping fix the script, I'd also like help on where to put a debounce so the script doesn't run too many times.
Report Abuse
kinglime is not online. kinglime
Joined: 27 Jun 2008
Total Posts: 2751
17 Jul 2013 03:32 PM
And it will not work.
Report Abuse
FriendlyLOLpwnzr is not online. FriendlyLOLpwnzr
Joined: 12 Sep 2011
Total Posts: 9320
17 Jul 2013 03:34 PM
That's why I am asking for help. If you can't help don't post.
Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
17 Jul 2013 03:45 PM
script.Parent.Parent.Parent.Workspace.Character.Humanoid.WalkSpeed = 32

loldafuq?

You can't do "Workspace.Character" because the character is named after your player.

If the part that touched the brick has a parent, then a child Humanoid, then it's a player. So;

function onTouched(hit) -- It's important you have hit in there.
if not debounce then
debounce = true
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Walkspeed = MYFAVENUMBER
--rest of script


end
debounce = false
end

Love me? Find me on Twitter! @DrWafflerRBLX
Report Abuse
FriendlyLOLpwnzr is not online. FriendlyLOLpwnzr
Joined: 12 Sep 2011
Total Posts: 9320
17 Jul 2013 03:47 PM
I'm a novice.
Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
17 Jul 2013 03:49 PM
I consider myself novice.

Love me? Find me on Twitter! @DrWafflerRBLX
Report Abuse
Frostglacier is not online. Frostglacier
Joined: 28 Oct 2010
Total Posts: 4177
17 Jul 2013 03:55 PM
debounce = false

function onTouched(part)
hum = part.Parent:FindFirstChild("Humanoid")
if hum ~= nil and debounce == false then
debounce = true
hum.WalkSpeed = 32
script.Parent.BrickColor = BrickColor.new("Medium stone grey")
script.Parent.Transparency = 0.5
wait(10)
hum.WalkSpeed = 16
script.Parent.BrickColor = BrickColor.new("Neon orange")
script.Parent.Transparency = 0
debounce = false
end

script.Parent.Touched:connect(onTouched)
Report Abuse
DrWaffler is not online. DrWaffler
Joined: 16 Sep 2011
Total Posts: 4248
17 Jul 2013 03:56 PM
@frost, I really like doing

if not debounce then

because I don't have to pre-define the variable.

Love me? Find me on Twitter! @DrWafflerRBLX
Report Abuse
FriendlyLOLpwnzr is not online. FriendlyLOLpwnzr
Joined: 12 Sep 2011
Total Posts: 9320
17 Jul 2013 04:01 PM
@frost

That doesn't work. :L
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