I'm trying to make a game with anti team kill but the only way to do that is to use force fields, the force fields do not last forever even though I made the forcefield time on the spawn infinite. Any help would be amazing.
If you want to give a player an indefinitely lasting force field, you have to insert a new force field into their character.
The code below gives the player an infinite force field every time their character spawns.
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) local field = Instance.new("ForceField") field.Parent = char end) end)
Although, force fields aren't the only way to avoid team-killing. You can have the weapons check for the holder's team, and the team of player who gets hit, and determine whether or not the player should take damage.
Good luck with your further development! :D
~Sethex, aka. TheWaterFoox