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

Change Walkspeed when you Step on a Brick? [closed]

Asked by 10 years ago

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!

1
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. Redbullusa 1580 — 10y

Closed as Not Constructive by Shawnyg and Perci1

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

3 answers

Log in to vote
0
Answered by 10 years ago

very simple

script.Parent.Touched:connect(function(hit)
h = hit.Parent:findFirstChild("Humanoid")
if h ~= nil then
h.WalkSpeed = 45
end
end)
Ad
Log in to vote
0
Answered by
woodengop 1134 Moderation Voter
10 years ago

Here Check this Tutorial By the ROBLOX Team https://www.youtube.com/watch?v=8ejtpQAYfpk

Log in to vote
0
Answered by 10 years ago

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)