I had 2 IDs in and yet it's not playing the other one and sticking to one ID only.
01 | local Chair = script.Parent |
02 | local AnimationIsPlaying |
03 |
04 | Assets = { 4295096597 , 4292616679 } |
05 | for _, asset in ipairs (Assets) do |
06 | game:GetService( "ContentProvider" ):Preload( "http://www.roblox.com/asset/?id=" .. asset) |
07 | end |
08 |
09 | local newAnim = Instance.new( 'Animation' ) |
10 | newAnim.AnimationId = "rbxassetid://" ..Assets [ math.random( 1 ,#Assets) ] |
11 |
12 | Chair.Changed:Connect( function (property) |
13 | if property = = 'Occupant' then |
14 | local occupant = Chair.Occupant |
15 | if not occupant then if AnimationIsPlaying then AnimationIsPlaying:Stop() return end end |
16 | AnimationIsPlaying = occupant:LoadAnimation(newAnim) |
17 | AnimationIsPlaying:Play() |
18 | end |
19 | end ) |
"Works fine for me, remember math.random is 100% luck, its rare, but you could still get the same sitting animation 50 times in a row." -Moo1210