I have a camp rp game and I was making an animation so when you touch the bed you lay down. But something does not seem to be working. The seat is not under any model/part, just the workspace.
function added(child)
if (child.className=="Weild") then
human = child.part1.Parent:FindFirstChild("Humanoid")
if human ~= nil then
anim = human:LoadAnimation(seat.sitanim)
anim:Play()
end
end
end
function removed(child2)
if anim ~= nil then
anim:Stop()
anim:Remove()
end
end
seat.ChildAdded:Connect(added)
seat.ChildRemoved:Connect(removed)