Hello everyone. I have this script, and it puts you on a certain team if you're in a group, and have the rank equal to or higher. As I am not the best at making scripts, I want to make sure my work is correct.
Here is the script below:
local ID = 737426 game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if player:GetRankInGroup(ID) == 4 then player.TeamColor = game.Teams["First Student"] player:LoadCharacter() else player.TeamColor = game.Teams["Civilian"].TeamColor player:LoadCharacter() end end
If anyone can answer, that would be much appreciated!
This is correct, other than line 06. You are attempting to set a player's teamcolor to a Team object. What you need to do is change the teamcolor the same way you do on line 09. You should also tab your code correctly, as it would make it easier to read.
local ID = 737426 game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:wait() if player:GetRankInGroup(ID) == 4 then player.TeamColor = game.Teams["First Student"].TeamColor player:LoadCharacter() else player.TeamColor = game.Teams["Civilian"].TeamColor player:LoadCharacter() end end
Thanks for the answers. This question is solved and needs no more answers.
««««CLOSED»»»»