How do I make it so that when the player sit in a seat it plays a custom animation rather than the default ROBLOX sitting animation?
-- Server Script local Players = game:GetService("Players") -- Our player service to use the PlayerAdded & CharacterAdded events. local SitAnimID = 507776043 -- Set to your specified animation id to replace the default sit idle animation. Players.PlayerAdded:Connect(function(Player) -- On player added Player.CharacterAdded:Connect(function(Character) -- When character is added local Animation = Character:FindFirstChild('SitAnim', true) -- Finding the sit animation in the character Animation.AnimationId = ('rbxassetid://%s'):format(SitAnimID) -- Replacing animation id with yours. end) end)
Hope this has helped, please learn from this and have a good day. If you have anything else you want to add on you can ask me. :)
Requested Script (Ignore)
-- Server Script local Players = game:GetService("Players") -- Our player service to use the PlayerAdded & CharacterAdded events. local SitIdleAnim = 507776043 -- Set to your specified animation id to replace the default sit animation. local Seats = { [workspace.Seat1] = 507770818; [workspace.Seat2] = 507770677; } -- For each seat as the key, the value will the animation you want to play Players.PlayerAdded:Connect(function(Player) -- On player added Player.CharacterAdded:Connect(function(Character) -- When character is added local Animation = Character:FindFirstChild('SitAnim', true) -- Finding the sit animation in the character local Humanoid = Character.Humanoid -- So we can use the GetPropertyChangedSignal Humanoid:GetPropertyChangedSignal('SeatPart'):Connect(function() local AnimationValue = Seats[Humanoid.SeatPart] -- if the part exists in the table as a key if not AnimationValue then -- if it's not then we'll set it to our idle animation Animation.AnimationId = ('rbxassetid://%s'):format(SitIdleAnim) else -- else if the animation does exist then it'll set to it's value that's in the table Animation.AnimationId = ('rbxassetid://%s'):format(AnimationValue) end end) end) end)