My remote doesnt fire

So I’m making a part where if you touch it it will change the player value then fire a remote to print saying it was fired but it doesn’t print that it was fired?!? this is the script inside the Touched Part:

local Players = game:GetService("Players")
script.Parent.Touched:Connect(function(P)
	if P.Parent:FindFirstChild("Transformed") then
		print("Found Transformed")
		P.Parent.Transformed.Value = script.Parent.Color
		P.Parent.Transformed.Type.Value = "Wolf"
		local Player = Players:GetPlayerFromCharacter(P.Parent)
		game.ReplicatedStorage.Transform.Transform:FireClient(Player)
	end
end)

then this is the code inside ServerScriptService:

local TransformRemote = game.ReplicatedStorage.Transform.Transform

TransformRemote.OnServerEvent:Connect(function(Player)
	local Character = Player.Character
	local TransformValue = Character:FindFirstChild("Transformed")
	local TransformType = TransformValue:FindFirstChild("Type")
	
	print("RemoteFired")
	
end)

It’s not firing because there’s no LocalScript calling FireServer. OnServerEvent connections are executed when FireServer is called; OnClientEvent connections are executed when FireClient is called. Appears you got confused there on which fires lined up to which on event signals.

If you do have a LocalScript that please also include that because that’s missing information that could help others see where the problem is at.

yeah but if i change the Touched script to a local script then it won’t even detect touched

Touched still works in LocalScripts, not particularly sure what you mean there. In general though it’s not like you need to change a LocalScript, just be aware of how remotes work and see if there’s a better solution that you can use. Remotes are designed for cross-environment communication not same-environment communication. That’s BindableEvents.

1 Like

Uh, touched not works at clients.

1 Like

Touched doesnt work with a localScript and I don’t understand? I just want to fire the event from the script.

Your making right, use server while firing, but at second script you just wrote TransformRemote.OnServerEvent. You should make it TransformRemote.OnClientEvent. OnServerEvent can only be used at firing from client.

yeah I just did but it still doesnt fire it?

1 Like

Your firing with normal script and getting from OnClientEvent with normal script right?

1 Like

Yeah Thats what Im doing. Since I cant use A localScript

You fired the client not the server. On the server script you say “OnServerEvent” when you should say “OnClientEvent”

Can you add a print when your getting the fire?

1 Like

Yeah I did on the server Script service but it doesnt print

He fixed it too but it doesn’t work

Is there something called “Transformed” in the player?

1 Like

Are there any errors in the output? If so what are they?

Yes Its a Color3 Value and inside it has a string value called type

1 Like

Is second script local? It needs to be local while getting OnClientEvent

That is true I think you might have solved it.

Do you mean the ServerScriptService script?