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

Local script doesn't show for other players?

Hi, I have a local script that rotates a player's head depending on where their camera is facing, however other players can't see others' heads turning and can only see their own rotating. How would I make it so everyone can see everyone's heads rotating, would I need to do something with ReplicatedStorage?

Any help would be great. :)

2 comments

0

It Would need to be inside of a server script since you are trying to move something inside the workspace

0

The script doesn't work in a server script

1 answer

✓ Accepted answer

To do that, try to make a RemoteEvent and trigger it whenever the camera rotation is changed. Send the new camera rotation as a parameter to the RemoteEvent. The RemoteEvent will be connected a server script, and the server script will change the rotation of the player from the parameter you passed. You do not have to specify which player to rotate the head, as there is a default 'player' parameter that is passed to your function that is listening to the RemoteEvent.

For an example, I will show you the server script:

-- Server Script
local event = game:GetService("ReplicatedStorage"):WaitForChild("HeadRotationEvent") -- put the name of the RemoteEvent there

event.OnServerEvent:Connect(function(player, newRotation)
	-- your code here
end

I hope this explanation is of help.

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