I am making a script that has a gui be visible while the player is hovering over a part. It is composed of a local and regular script.

Regular script:

script.Parent.ClickDetector.MouseHoverEnter:Connect(function(plr)
	script.Parent.LocalScript.HoverOn:FireClient(plr)
end)

script.Parent.ClickDetector.MouseHoverLeave:Connect(function(plr)
	script.Parent.LocalScript.HoverOff:FireClient(plr)
end)

Local script:

script.HoverOn.OnClientEvent:Connect(function()
	game.Players.LocalPlayer.PlayerGui.ScreenGui.Enabled = true
end)

script.HoverOff.OnClientEvent:Connect(function()
	game.Players.LocalPlayer.PlayerGui.ScreenGui.Enabled = false
end)

Based on the client output I viewed when I published the game and check the dev console, the OnClientEvent isn't detecting that the remote event was fired.

1 comment

0

I don't understand why you would need remote events. Just put it all in a local script. Remove the event handlers.