When I touch a part, i want the player to sit down. But if they jump, the stand (like normal)
script.Parent.Touched:connect(function(hit)
local Player = hit.Parent:FindFirstChild("Humanoid")
Player.Humanoid.Sit = true
end)
When I touch a part, i want the player to sit down. But if they jump, the stand (like normal)
script.Parent.Touched:connect(function(hit)
local Player = hit.Parent:FindFirstChild("Humanoid")
Player.Humanoid.Sit = true
end)
Player already references the humanoid and not the character. Simply change line 6 to Player.Sit.
script.Parent.Touched:connect(function(hit)
local Player = hit.Parent:FindFirstChild("Humanoid") --"Player" referring to Humanoid
Player.Sit = true --Player.Sit == hit.Parent.Humanoid.Sit
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.