The purpose of this script is to load a GUI when a player on the 'soldier' team spawns.
Please tell me where I went wrong,
Respectfully, M
local ui = game.ReplicatedStorage.Gui2 --This is the gui to be cloned
game.Players.CharacterAdded:connect(function(plr)
if (plr.TeamColor == game.Teams["soldier"].TeamColor) then
local plrui = plr:WaitForChild("PlayerGui");
ui:Clone().Parent = plrui;
end
end)

1 comment
I edited your question for a codeblock. Please do this yourself in the future: https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site