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

How do I make the sitting anims work (for vibe game)?

Basically I'm making a vibe game, I have sit anims that are already scripted but show up in only my screen, I did a team test to check but only I could see it, my friend sent a photo of how their screen was but it showed as if it was a normal sit anim. here's the script, 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.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) how do you make it a server script instead of a local?? i don't think it's the script's problem, the animation only plays for the animation creator???

4 comments

1

Is your script LocalScript or Server Sript? Maybe that is the problem

0

I believe it's a local script, I'll try it out

0

A LocalScript will only show the animations locally, so you need to play the animation on the server. You should probably use a RemoteEvent for this.

0

How do you use a remote event?? i'm new to scripting, can you answer in the answer this question part??

1 answer

✓ Accepted answer

The best thing to do when animating for a seat would be to place a Script inside of the actual Seat you would like to use. Note the is a script and NOT a local script. After creating a script inside of the seat, place your sitting animation in the seat as well. Next inside the script copy and paste this:

seat = script.Parent
function added(child)
	if (child.className=="Weld") then
		local human 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)

If you have any questions just respond below.

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