Output error is "obstructing" the other errors and i dont know how to fix it

So basically its a script to make a custom pose, but i think its checking everytime if the player is sitting or something and its getting thousand errors on output and its really stressing

image

seat = script.Parent
function added(child)
	if (child.className=="Weld") then
		human = child.part1.Parent:FindFirstChild("Humanoid")
		if human ~= nil then
			anim = human:LoadAnimation(seat.Animation)
			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)
1 Like

Seems like the weld’s Part1 property is empty. Instead of relying on welds, can’t you just check the Occupant property and directly set the sitting animation in the Player’s Animate script?

I made many posts with code I have given relating to this issue and they seemed to work for them,

You can try this

local seat = script.Parent
local animId = seat.Animation.AnimationId
local defaultAnim = "http://www.roblox.com/asset/?id=2506281703"
local formeroccupant

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local humanoid = seat.Occupant
	if humanoid then
		local char = humanoid.Parent
		char.Animate.sit.SitAnim.AnimationId = animId
		formeroccupant = char
	else			
		formeroccupant.Animate.sit.SitAnim.AnimationId = defaultAnim
		formeroccupant = nil
	end
end)

And it should work fine if your rigs are R15, if not, the 1st post I sent has code that should work if you’re using R6

2 Likes

thanks for the help and that worked, but im struggling with the animations, because the player is always sometimes a little further than it should be, always misplaced, but i guess its a question for another post, thanks for the help!

1 Like

It’s probably an issue with your animation? That’s all I can really think is going on

If you have anymore issues don’t be afraid to make another post!

1 Like

yea well i followed some tutorials making this custom poses and i dont know what went wrong maybe the seat position but its perfectly aligned, i guess the only solution is playing around with the animation and the seat position

1 Like