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

why wont my animation run inside the roblox player but it will in studio?

Asked by 3 years ago

whenever i run this script it works in studio but then when i go to test it in the roblox player it dosnt work

local sitAnim = id
local seat = workspace.setup.chair.Seat
local playingAnim 

local newAnim = Instance.new('Animation')
newAnim.AnimationId = 'rbxassetid://'..sitAnim

seat.Changed:Connect(function(property)
    if property == 'Occupant' then
        local occupant = seat.Occupant
        if not occupant then if playingAnim then playingAnim:Stop() return end end
        playingAnim = occupant:LoadAnimation(newAnim)
        playingAnim:Play()
    end
end)

Answer this question