Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Trying to get a sitting animation seat for only one seat, can someone help?

I've just created a sitting animation, and I want to make it that if I sit down on a chosen seat it will use my animation, but for my other seats it won't. Can anyone help me?

1 comment

0

Try getting the seat ocuppant and setting the animation for him

2 answers

✓ Accepted answer

check when a child is added that is a weld and is named "SeatWeld"

script.Parent.ChildAdded:Connect(function(c) -- when a child is added (assuming the parent is the seat)
	if c:IsA("Weld") and c.Name == "SeatWeld" then -- if the added child is a weld and is named "SeatWeld"
		if c.Part1.Parent:FindFirstChildOfClass("Humanoid") then -- if the script finds a humanoid
			local anim = Instance.new("Animation") -- makes the animation
			anim.AnimationId = "rbxassetid://AssetIdHere"  -- sets the id of it
			local track = c.Part1.Parent:FindFirstChildOfClass("Humanoid"):LoadAnimation(anim) -- loads the animation
			track:Play() -- plays the animation
		end
	end
end)

2 comments

0

local script or just a script?

0

a script in the seat

This discussion is preserved as it was. New answers, comments, and votes are closed.