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.
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.
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.