I need help with this change! Basically, I'm making an obby, but whenever the player goes over the first checkpoint, it either puts the player in a "Neutral" team or just doesn't put the player under the category.
Right now, my teams and checkpoints are named 0-2 (0, 1, 2)
I saw someone in another forum use this code:
part = workspace.partname
part.Touched:connect(function(h)
if game.Players:GetPlayerFromCharacter(h.Parent).Team == game.Teams.Teamname then
else
game.Players:GetPlayerFromCharacter(h.Parent).Team = game.Teams.Teamname
game.Players:GetPlayerFromCharacter(h.Parent).Humanoid:TakeDamage(math.huge)
end
end)
But I'm not sure if it works, and if it does, I have no idea how to work it around my team names. I have no idea how to read or write code in general lol
Any help would be appreciated!! Including code and adjusting my teams/checkpoints(spawn locations) buttons in the properties menu

2 comments
Did you try it ? It looks fine. Just change the Teamname to your team name.
i dunno how to "encode lua code in the lua block code tag" :,] sorry man