ive tried to set a team by having a player tp to a brick which changes their team but just doesnt change the team whatsoever
my script:
local Jteam = teams.Juggernaut
local Jmaxplayers = Jteam:GetPlayers()
local val = #Jmaxplayers
function onTouch(hit)
if val == 1 then
hit.Parent.Humanoid.MaxHealth = 100
hit.Parent.Humanoid.Health = 100
hit.TeamColor = BrickColor.new("Storm blue")
end
if val == 0 then
hit.Parent.Humanoid.MaxHealth = 500
hit.Parent.Humanoid.Health = 500
hit.TeamColor = BrickColor.new("Persimmon")
end
end
script.Parent.Touched:Connect(onTouch)
note: the tp code isnt meant to be in this script so basically it tps me to the brick but does not change the team