I can't get this to work.
if isOnTeam(game.Players.LocalPlayer, "Navy blue") then
game.Players.LocalPLayer:Remove()
end
Anybody know how?
I can't get this to work.
if isOnTeam(game.Players.LocalPlayer, "Navy blue") then
game.Players.LocalPLayer:Remove()
end
Anybody know how?
Team Colours are BrickColors. Use BrickColor.new('Navy blue')
I would advise doing something like this
if game.Players.LocalPlayer.TeamColor == BrickColor.new("Navy blue") then
game.Players.LocalPlayer.Character:Destroy()
end
Alternatively,
if game.Players.LocalPlayer.TeamColor == BrickColor.new("Navy blue") then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
end
(This version will kill the player instead of making them disappear, if I'm correct)
There is no reason that I know of to use a function to compare two values. Make sure this is running on a localscript, as only localscripts can see the localplayer for obvious reasons. As it needs to modify an object in the workspace and be a localscript, FilteringEnabled needs to be off. The player (Under game.Players) and the player's character (Under workspace and is the player's actual body) are two different things. If you want to kill the player, destroy or damage the character. Also, the L in Player on line 2 is capitalized.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Line 2, LocalPLayer. Line 2, Remove is Deprecated. Line 1, attempt to call function isOnTeam a nil value.