Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with this script?

Asked by 10 years ago
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

Log in to vote
0
Answered by 10 years ago

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)

Ad

Answer this question