hi so i want to know how you can make remote events to happen server or client to make a gui visible i really need help heres my current attempt
local event = game.ReplicatedStorage.RemoteEvent script.Parent.ClickDetector.MouseClick:Connect(function() local player = game.Players.LocalPlayer local gui = player.PlayerGUI event:Fire(player,gui) end)
Here are the steps to your fixed script.
1) Make sure you have the Remote Event inside of ReplicatedStorage
2) Have your workspace script set to a regular script
3) Have a LocalScript
inside of StarterGUI.
Next, we get to the scripting part.
Regular Script:
local event = game.ReplicatedStorage:WaitForChild("RemoteEventName") local clickdetector = script.Parent clickdetector.MouseClick:Connect(function(player) event:fireClient(player) end)
LocalScript:
local event = game.ReplicatedStorage:WaitForChild("RemoteEventName") event.OnClientEvent:Connect(function() --Put your desired line of code here end)
Hope this helped you!