if v:FindFirstAncestor(Stage.Name) then
ReplicatedStorage.Highlights:FireClient(player, v, true)
else
ReplicatedStorage.Highlights:FireClient(player, v, false)
end
Client:
local HighlightsEvent = game.ReplicatedStorage:WaitForChild("Highlights")
HighlightsEvent.OnClientEvent:Connect(function(instance, bool)
instance.Enabled = bool
end)
I’m a mid coder, and without further context, i cant really say. However, I would troubleshoot by printing something at every step of the way, like “a” on one step, or “b” on the other. I would also try printing the instance on the “HighlightsEvent.OnClientEvent:Connect(function(instance, bool)” function. Maybe you are trying to pass the wrong object?
Yes, you can send an instance through remote event parameters but both the client and the server have to be able to see it.
For example, if the server is sending something that is in ServerStorage, player clients will recieve it as nil as they cannot access anything inside ServerStorage.