01 | local player = game.Players.LocalPlayer |
02 | local Mouse = player:GetMouse() |
03 | local GUI = script.Parent.MainGUI |
04 | Mouse.KeyDown:connect( function (key) |
05 | if key = = "f" and GUI.Visible = = false then |
06 | GUI.Visible = true |
07 | elseif key = = "f" and GUI.Visible = = true then |
08 | GUI.Visible = false |
09 | end |
10 | end ) |
For some reason, ROBLOX only recognizes LocalPlayer, and Player1 (The Test For Roblox Studio) what should I use to replace LocalPlayer, so that everyone can open the shop?
1 | local player = game.Players.LocalPlayer |
2 | local Mouse = player:GetMouse() |
3 | local GUI = script.Parent.MainGUI.Frame |
4 |
5 | Mouse.KeyDown:connect( function (key) |
6 | if key = = "f" then |
7 | GUI.Visible = not GUI.Visible |
8 | end |
9 | end ) |
You were calling on the GUI, not the frame inside. The GUI object is to hold the GUI elements. If everything is messy in the GUI then just put it in a frame that fits the whole screen.