So, currently, I am trying to make it so whenever you click a click detector, it makes a GUI pop up. Can you try to help me?
Part 1 (Local Script):
local RepliactedStorage = game:GetService("ReplicatedStorage")
local ShowGUI = RepliactedStorage:WaitForChild("ShowGUI")
local ClickDetector = game.Workspace.Part.ClickDetector
local Gui = game.StarterGui.ScreenGui.Frame
ClickDetector.MouseClick:Connect(function()
print("Recived")
ShowGUI:FireServer(Gui)
print("Success")
end)
This basically fires the remote event when you click the part
Part 2 (Script):
local RepliactedStorage = game:GetService("ReplicatedStorage")
local ShowGUI = RepliactedStorage:WaitForChild("ShowGUI")
local Gui = game.Players.LocalPlayer.Playergui.ScreenGui.Frame
ShowGUI.OnServerEvent:Connect(function(player, gui)
Gui.Visible = true
end)
This script activates when the remote event is fired, and tries to make the GUI visible but doesn't work? Help me, please!
Output:
05:27:55.391 - Baseplate auto-recovery file was created
05:27:55.836 - ServerScriptService.ServerScriptShowGui:3: attempt to index nil with 'Playergui'
05:27:55.837 - Stack Begin
05:27:55.837 - Script 'ServerScriptService.ServerScriptShowGui', Line 3
05:27:55.838 - Stack End
Recived
Success

6 comments
I’m just going to say this right now, you went way to far. It’s simple but you made it hard, I can solve it but you are going to have to wait a couple of hours till I can get to my computer and test out the script for you.
Ok
U can do everything locally
No need for the remote event
Firing an event isn't necessary here since you are not trying to get a client to talk to the server, instead you could have it all done in the LocalScript
I know I could've, this was just to mess with RemoteEvents since I'm just learning them. And they are extremely valuable.