Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do you make a user have fast walkspeed ontouch a brick?

Asked by 10 years ago

**Hi guys, I'm a beginner scripter, and I need some help with a brick that will change the user's walkspeed.

Think you can help? Thanks!

What I have so far looks like

local.workspace.humanoid.(user).ontouch.walkspeed-50

That seems right to me, but as I said, I'm a beginner.

Please help, I'd appreciate it ALOT.

-DevNitroade100**

1 answer

Log in to vote
1
Answered by 10 years ago

insert the following > script inside the part

function speedup(hit)
if hit and hit.Parent and hit.Parent ~= script.Parent then -- makes sure everything is correct, like if it isn't touching itself

if hit.Parent:FindFirstChild("Humanoid") then -- make sure the thing that touched the button is an actual person
local humanoid = hit.Parent:FindFirstChild("Humanoid")
humanoid.WalkSpeed = 50 -- sets the speed
end
end
end

script.Parent.Touched:connect(speedup)
0
Thank you so much! :) You saved my game from becoming a nonworking piece of junk xD JustGimmeDaBux 18 — 10y
Ad

Answer this question