Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Making a Gui Invisible..?

local plrGui = game.Players.LocalPlayer.PlayerGui
local invP = plrGui.Core.Inventory
local exit = invP.Exit

repeat wait() until game.Players.LocalPlayer
function OnClicked(playerwhoclicked)
	invP.Visible = false
end

script.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

2 comments

0

Uh... are you using a Script, or LocalScript?

0

Are you trying to remove that annoying line above?

2 answers

✓ Accepted answer
-- script in parent
script.Parent:Remove()

3 comments

0

Ty

0

Remove is depreciated.

0

XD that was a joke maybe it actually works but ...

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

This discussion is preserved as it was. New answers, comments, and votes are closed.