I’m trying to clone a folder to my PlayerGui.
I tried cloning it in other places, that seemed to work. Yet not in my PlayerGui.
local players = {"EugeneFaung", "ROBLOX"}
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
for i = 1, #players do
if players[i] == plr.Name then
game.ServerScriptService["Close Air Support"].M1Client:Clone().Parent = plr:WaitForChild("Backpack")
local clone =game.ServerScriptService["Close Air Support"]["Air Support UI"]:Clone()
clone.Parent = plr.PlayerGui
print("added")
end
end
end)
end)
local players = {"EugeneFaung", "ROBLOX"}
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
for i = 1, #players do
if players[i] == plr.Name then
game.ServerScriptService["Close Air Support"].M1Client:Clone().Parent = plr:WaitForChild("Backpack")
local clone =game.ServerScriptService["Close Air Support"]["Air Support UI"]:Clone()
clone.Parent = plr:WaitForChild("PlayerGui")
print("added")
end
end
end)
end)
Alright, here is a solution that should work: You don’t need to re-add the GUI everytime the character is added, just disable the ResetOnSpawn (or something similar) property under the GUI objects.
The thing is, The reason I’m cloning both of them is so that only select players get access to them. Is there a way I can put them into a select StarterGui?
Turning off that property doesn’t make it so anyone can have that GUI. All it does is that it stops the GUI from getting destroyed everytime the character is reset. (Of course only if the player even had it in the first place.)