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

How do I make an npc jump if it's on a seat?

Asked by 3 years ago

Just like in the title. I wanted to know, how do I make something like "if NPC tripped or sits make it jump". I don't want it to be for a player, I want it for a specific NPC. Thanks.

1 answer

Log in to vote
1
Answered by 3 years ago

You should want your humanoid to change state. If you want it to be a specific NPC, then put this script inside.

local Humanoid = script.Parent:FindFirstChild("Humanoid")

if Humanoid:GetState() == Enum.HumanoidStateType.Seated then
    Humanoid:ChangeState(Enum.HumanoidStateType.Jump)
end

The :GetState() method is used to find what the current humanoid state is in, the :ChangeState method is used to change the humanoid state.

Ad

Answer this question