This script is supposed to clone the localscript in it into the player if they are on the zombies team.
game.Players:GetPlayers()
if Player.TeamColor = "Medium Green"
game.Workspace.Zombies.LocalScript:Clone()Player
end
This script is supposed to clone the localscript in it into the player if they are on the zombies team.
game.Players:GetPlayers()
if Player.TeamColor = "Medium Green"
game.Workspace.Zombies.LocalScript:Clone()Player
end
Note: This will only run once.
while true do
wait()
for k,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor = BrickColor.new("Medium Green") then
workspace.Zombies.LocalScript:Clone().Parent = v.PlayerGui
end
end
end
The way you were doing it was just wrong.
GetPlayers transforms all the players into a table that you will be able to iterate through.
TeamColor is a BrickColor.
When using clone you need to set the parent you want the clone to be located in.
Read more:
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
wait, will it loop if I do whiletruedo?
Yep.
Okay, thanks.