function touch(hit)
if hit then
game.Players:FindFirstChild("Humanoid") -- stuck here, don't know what to do
end
end
script.Parent.Touched:Connect(touch)
✓ ANSWER ACCEPTED
Set player's walkspeed down to 0 when he touches brick?
1 answer
✓ Accepted answer
You are doing it wrong at line 2, i think you are checking humanoid, this is how you do it:
function touch(hit)
local hum = hit.Parent:FindFirstChild("Humanoid") --- Find humanoid by the parent of the part that touched it
if hum then -- It is exist !
hum.WalkSpeed = 0
end
end
script.Parent.Touched:Connect(touch)
This discussion is preserved as it was. New answers, comments, and votes are closed.
