Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how would i make a sitting animation replace without a touched event?

a lot of scripts that i've seen have a touched event on a seat that changes the animation, how could i make the animation work if someone sits down? I don't know how i would identify the player without a touched event either

tl;dr how could i identify a player sitting without a touched event?

1 answer

✓ Accepted answer

You could use player added, and listen for a sit event.

game.Players.PlayerAdded:Connect(function(player)
local plrhum = player.Character:FindFirstChild("Humanoid")
plrhum.HumanoidStateType.Changed:Connect(function()
while plrhum.HumanoidStateType == Enum.Seated do
--Code Here
end
end)
end)

Humanoid state type 13 is the value for being seated. You can changed the while to be a if statement if you just want code to run once.

1 comment

0

It has to be an enum, not the value or name

This discussion is preserved as it was. New answers, comments, and votes are closed.