Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Making a Gui Invisible..?

Asked by 10 years ago
01local plrGui = game.Players.LocalPlayer.PlayerGui
02local invP = plrGui.Core.Inventory
03local exit = invP.Exit
04 
05repeat wait() until game.Players.LocalPlayer
06function OnClicked(playerwhoclicked)
07    invP.Visible = false
08end
09 
10script.Parent.MouseButton1Down:connect(OnClicked)

OutPut Says LocalPlayer is a nill value

this is the errors

20:13:15.737 - local plrGui = game.Players.LocalPlayer.PlayerGui local inv:1: attempt to index field 'LocalPlayer' (a nil value) 20:13:15.737 - Stack Begin 20:13:15.738 - Script 'local plrGui = game.Players.LocalPlayer.PlayerGui local inv', Line 1 20:13:15.738 - Stack End

0
Uh... are you using a Script, or LocalScript? funyun 958 — 10y
0
Are you trying to remove that annoying line above? iNicklas 215 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago
1-- script in parent
2script.Parent:Remove()
0
Ty xlaser23 60 — 10y
0
Remove is depreciated. ChemicalHex 979 — 10y
0
XD that was a joke maybe it actually works but ... DiamondCookie2 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Simple. Set it into a localscriptrather than a script. LocalPlayer Is a variable only for local scripts.

Answer this question