local admins = {"noobs88", "aquathorn321"}
game.Players.PlayerAdded:connect(function(player)
local admin = false
for i,v in pairs(admins) do
if player.Name:lower() == v:lower() then
admin = true
break
end
if admin then
player.Chatted:connect(function(msg)
if msg:lower() == "gui" and not player.PlayerGui:FindFirstChild("UploadLimited") then
local gui = game.Lighting.UploadLimited:Clone()
gui.Parent = player.PlayerGui
end
end)
end
end)
The only problem with your script was that you created the clone and parented it in the same line. This won't work, as the merciless garbage collector just eats it up. I recommend moving the gui to replicated storage and check to see if the player already has the gui before cloning it again. I went ahead and fixed the second part for you.
I haven't tested this in studio, so let me know if it gives you any problems
4 comments
This looks like it should work. What exactly is the problem?
I would store gui's in StarterGui, why is it in lighting???
It was just where I was keeping it
I see your problem, the parenthesis that you have on line 8 is actually supposed to be on line 7. Line 8 is the end to the if then statement, and line 7 is the end of the chatted event.