Help on NPC Sitting Animation

So I made this script, but its not working!

local SitAnim = Instance.new("Animation")
SitAnim.AnimationId = "http://www.roblox.com/asset/?id=8848143392"
local controller = script.Parent.Humanoid
local Animation = controller:LoadAnimation(SitAnim)

if controller.Sit == true then
	Animation:Play()
end
	

Can anyone help me on this? Thanks!

statements runs straight and once
statements are not detectors Xd
you need to repeat running it

but in this situation you can just call a function you dont need statements
humanoid has a function for detecting this and its called Seated

local SitAnim = Instance.new("Animation")
SitAnim.AnimationId = "http://www.roblox.com/asset/?id=8848143392"
local controller = script.Parent.Humanoid
local Animation = controller:LoadAnimation(SitAnim)

local function OnSit()
	Animation:Play()
end

controller.Seated:Connect(OnSit)
3 Likes

Oh, got it, thank you so much, you just solve my problem that I’ve veen struggling for 3 hours