01 | player = script.Parent.Parent.Parent |
02 | mouse = player:GetMouse() |
03 | invBox = game.StarterGui.ScreenGui.Frame |
04 | local open = false |
05 |
06 | function inv(key) |
07 | key = key:lower() |
08 |
09 | if key = = "p" then |
10 | if open then |
11 | player.PlayerGui.ScreenGui.Frame.Visible = false -- You can change "Frame" or "ScreenGui" to your Gui's name(s) |
12 | open = true |
13 | open = false |
14 | return |
15 | end |
If I were to put the script into PlayerScripts then it would work just fine
if I make player = script.Parent.Parent
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?