2

# How do you insert a local script into player gui?

Asked by 7 years ago

I wanted to remove health, playerlist, and backpack. But it won't allow me to put it in there without me having to start a server and won't save. I used a script to switch the parent to playergui. Can you help me?

1
Answered by 7 years ago

You could put the Script in StartGui, if you mean the Player's PlayerGui, or you could make a script;

game.Players.PlayerAdded:connect(function(plr)
if plr and plr.PlayerGui then
find=script:FindFirstChild("LOCALSCRIPTNAMEHERE")
if find then
find:Clone()
find.Parent=plr.PlayerGui
end end end)


But if you mean a ScreenGui, that I can't really help with that, learning ScreenGui's myself. :P

I hope this helped!

0
Very thank you! GreekGodOfMLG 244 — 7y
0
No problem bro. ;) TheeDeathCaster 2336 — 7y
0
But its saying that playergui is not valid member of player :L GreekGodOfMLG 244 — 7y
0
If you have FilteringEnabled on, then thats what causing it, I dont know how and why it does that, but thats one of the main things that mess up scripts like this, if its not that, then I'm surely confused. :L TheeDeathCaster 2336 — 7y
0
Everesty 1001
7 years ago

Anything located in the StarterGui service will be cloned into a player's PlayerGui whenever they spawn (this can be edited, but doesn't need to be right now, so no worries). Simply just put your script in there and it'll work just fine.