Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is wrong with this script?

game.Players.ChildAdded:connect(function(newP)
if newP.className == "Player" then
if newp.TeamColor == "Survivors" then
game.Teams["Survivors"]G18:Clone().Parent = newP.StarterGear
elseif newp.TeamColor == "Zombies" then
game.Teams["Zombies"]Zombie:clone().Parent = newP.StarterGear
end
end
end)

1 answer

Lua is Case Sensitive make ClassName capital

game.Players.ChildAdded:connect(function(newP)
if newP.ClassName == "Player" then
if newP.TeamColor == "COLOR OF TEAM" then
game.Teams["Survivors"]G18:Clone().Parent = newP.StarterGear
elseif newP.TeamColor == "COLOR OF TEAM" then
game.Teams["Zombies"]Zombie:clone().Parent = newP.StarterGear
end
end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.