I'm making a pixel art game where you can disable other players from coming to where you draw. What I'm trying to do is detect a player's previous team, so that I can make their bridge able to collide again if they have no teammates. Here's a bit of my script:
print(player.Name.. " has joined " ..team.Name)
local resetBridge = true
for _,rPlr in pairs(game.Players:GetChildren()) do
if rPlr.TeamColor == plr.TeamColor and rPlr.Name ~= plr.Name then
print("has teammates")
resetBridge = false
end
end
if resetBridge == true then
print("reset bridge")
local path = workspace.Paths:FindFirstChild(tostring(plr.Team))
if path then
print("found path")
path.Transparency = 0
path.CanCollide = true
end
end
It prints when a player joins a team, but the problem is that it only picks up the new team when it tries to make the path able to collide.
