Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I finish this Team Changing script?

Asked by 10 years ago

I have a small section of script I have written myself. Problem is I have no clue how to finish it? I would like it to spawn people from the group '0000' that have the rank of '000' (place holders, of course) to spawn directly on the separate team. Any ideas folks?


game.Players.PlayerAdded:connect(function(player) if player:IsInGroup(0000) and player:IsRank(000) then end end)

1 answer

Log in to vote
0
Answered by 10 years ago

Insert the team service and the team objects in that service. Then make the team the color and name you want. When you did that add this script to ServerScriptStorage:

local GroupId = value -- replace with group id (int)
local Rank = value2 -- replace with the rank (int)
local Team = game.Teams:FindFirstChild("string") -- replace with the team name (string)

game.Players.PlayerAdded:connect(function(player)
    if player:GetRankInGroup(GroupId) == Rank then
        player.TeamColor = Team.TeamColor
    end
end)

If this doesn't work, please tell me

Ad

Answer this question