Trying to make a GUI pop up from a part but wont work??
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):
01 | local RepliactedStorage = game:GetService( "ReplicatedStorage" ) |
02 | local ShowGUI = RepliactedStorage:WaitForChild( "ShowGUI" ) |
03 | local ClickDetector = game.Workspace.Part.ClickDetector |
04 | local Gui = game.StarterGui.ScreenGui.Frame |
06 | ClickDetector.MouseClick:Connect( function () |
08 | ShowGUI:FireServer(Gui) |
This basically fires the remote event when you click the part
Part 2 (Script):
1 | local RepliactedStorage = game:GetService( "ReplicatedStorage" ) |
2 | local ShowGUI = RepliactedStorage:WaitForChild( "ShowGUI" ) |
3 | local Gui = game.Players.LocalPlayer.Playergui.ScreenGui.Frame |
5 | ShowGUI.OnServerEvent:Connect( function (player, gui) |
This script activates when the remote event is fired, and tries to make the GUI visible but doesn't work? Help me, please!
Output:
1 | 05 : 27 : 55.391 - Baseplate auto-recovery file was created |
2 | 05 : 27 : 55.836 - ServerScriptService.ServerScriptShowGui: 3 : attempt to index nil with 'Playergui' |
3 | 05 : 27 : 55.837 - Stack Begin |
4 | 05 : 27 : 55.837 - Script 'ServerScriptService.ServerScriptShowGui' , Line 3 |
5 | 05 : 27 : 55.838 - Stack End |