Local script won't react to RemoteEvent

Hello, I tried to make a script character change, I did it quickly. But the problem is that the local script does not react to FireClient. Everything works, the character itself changes, but I need to make the camera Subject = Humanoid. This needs to be done in a local script, but it doesn’t work.
I hope you understood me
Server script:

game.Players.PlayerAdded:Connect(function(player)
game.ReplicatedStorage.RoundStarted.Changed:Connect(function(value)
	print(value) -- its works
	if value then
		if player.Character:FindFirstChild("Humanoid") then
			print("found") -- its works
				local hum = player.Character.Humanoid
				player.Character = workspace.Dummy1
			game.ReplicatedStorage:WaitForChild("RemoteEvent"):FireClient(player,game.Workspace.Dummy1.Humanoid)
			print("fired") -- its works
		end
	end
	end)
end)

Local script

local remoteevent = game.ReplicatedStorage:WaitForChild("RemoteEvent")

remoteevent.OnClientEvent:Connect(function(humanoid) -- this is doesn't work and there is no errors

print(humanoid) -- wont prints

game.Workspace.CurrentCamera.CameraSubject = humanoid

end)

image
This is how it looks

I tried to search, but found only that it was a error in studio, but this post was in 2020

1 Like

dont use game.Workspace use workspace

the humanoid is an instance, hence not printing. try using format document. the script doesn’t understand where the function ends.

format the server script too.

What does format document mean?

1 Like

print the humanoid name
print(humanoid.Name)

See if that prints the name.

game.ReplicatedStorage:WaitForChild(“RemoteEvent”):Connect(function(humanoid)

end)

print(“Humanoid”)

LocalScripts will not run in ReplicatedStorage refer to this documentation page on where to store LocalScripts

1 Like

Thanks! I thought about it, but for some reason I didn’t put it in Replicated First. Everything works, the character changes.

its a button in script gui. click “Format” and click “Format Document”

Thanks! This helps me sort the script!