Remote Events Support

Hey, I’m trying to send animation data from the client to the server so it can be run server sided (so all players can see it)

I tried running print(Animation) to see the output and it just outputted my username.

Local Script (In a screenGUI)

Events.Startup.OnClientEvent:Connect(function(Animation)
	
	Events.RunAnim:FireServer(Animations.Start)

	--	VoiceLines.StartVoice:Play()

	typewrite(Subtitles, "Hello! Would you like to check in?",0.05)
	
	-- Buttons appear

end)

Server Script

Events.RunAnim.OnServerEvent:Connect(function(Animation)
	
	local StartUpAnim = AI.Humanoid:LoadAnimation(Animation)
	StartUpAnim:Play()
	
end)

The first argument passed to .OnServerEvent is the player who fired it, then anything passed after that.

So your corrected code would be event.OnServerEvent:Connect(function(player, animation)...

1 Like

You don’t need a remote event for this; animations ran on local scripts get replicated to the server.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.