I want to do this for one of my games, and I don't have a single clue how to do it, I don't even know what to code for this. Please help!
COMMUNITY QUESTION
Change Walkspeed when you Step on a Brick?
3 answers
very simple
script.Parent.Touched:connect(function(hit)
h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.WalkSpeed = 45
end
end)
Here Check this Tutorial By the ROBLOX Team https://www.youtube.com/watch?v=8ejtpQAYfpk
Adding on to chimmihc's answer:
brick = script.Parent -- the script is inside the brick so we make it a variable
brick.Touched:connect(function(hit) -- We create a touch event using a function with a parameter of hit
h = hit.Parent:findFirstChild("Humanoid") -- We look for the humanoid of the player
if h ~= nil then -- If the humanoid exists then...
h.WalkSpeed = 45 -- We set their walkspeed to 45
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
This is not a request site. That information can be found by referring to one of Roblox's uploaded videos on YouTube (Hour of Code Part 3) or the Roblox Wiki.