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

I'm trying to make a game where a brick being touched changes humanoid's Walkspeed?

Asked by 5 years ago

Hello, I am currently making a game that involves a brick being touched, when touched the individual player's walkspeed changes. Here's what I currently have. (I did insert a humanoid named 'StarterHumanoid')

script.Parent.Touched:Connect(function(hit)
    game.StarterPlayer.StarterHumanoid.WalkSpeed = 30
end)

Any help would be appreciated, thanks!

1 answer

Log in to vote
0
Answered by 5 years ago
script.Parent.Touched:Connect(function(hit)
  if hit.Parent:FindFirstChild("Humanoid") then
    hit.Parent.Humanoid.WalkSpeed = 30
  end
end)
Ad

Answer this question