This is suppose to be a kick panel visible only for people I whitelist, but it doesn't work and it says in the Output : "PlayerGui is not a valid member of StartGui"
1 | local WhiteList = { "PLAYNAME" } |
2 | local player = game.Players.Name |
3 | --this script goes in the Gui. It removes if the owner has no gamepass |
4 | plr = script.Parent.Parent.Parent --Should lead to parent of PlayerGui (startergui) |
5 | repeat wait() until plr.PlayerGui |
6 | if not player = = WhiteList then |
7 | script.Parent:Destroy() |
8 | end |
9 | --This should make me see the kick panel-- |
Anybody help ? thanks
Try this,
1 | player = game.Players.LocalPlayer |
2 | if player.Name = = WhiteList then |
3 | gui.Visible = true |
Try it out, if it doesn't work let me know.