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

Script doesn't team me to proper team based on my group rank?

Asked by 1 year ago

I made script that should team me to tea, based on my rank group, but it teams me to random team, can someone help me fix this?

local Teams = game:GetService("Teams")
local Visitorst = Teams:WaitForChild("Visitors")
local LowRankt = Teams:WaitForChild("Low Ranks")
local MiddleRankt = Teams:WaitForChild("Middle Ranks")
local HighRankt = Teams:WaitForChild("High Ranks")
local SeniorHighRankt = Teams:WaitForChild("Senior High Ranks")
local HeadOfficet = Teams:WaitForChild("Head Office")
local Ownershipt = Teams:WaitForChild("Ownership Team")

local groupID = 16522602

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function()
        local playerank = player:GetRankInGroup(groupID)

        if playerank >= 253 then
            player.Team = Ownershipt
        elseif playerank >= 247 then
            player.Team = HeadOfficet
            print("Hello world")
        elseif playerank >= 243 then
            player.Team = SeniorHighRankt
        elseif playerank >= 236 then
            player.Team = HighRankt
        elseif playerank >= 225 then
            player.Team = MiddleRankt
        elseif playerank >= 115 then
            player.Team = LowRankt
        elseif playerank >= 1 then
            player.Team = Visitorst
        end
    end)
end)
0
are there any errors in output? MarcTheRubixQb 153 — 1y
0
No 18890miki 4 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago

I think I know where you have gone wrong

you need to use the TeamColor attribute

like so:

player.TeamColor = Ownershipt.TeamColor

let me know If it works once you try this.

0
Doesn't work 18890miki 4 — 1y
0
Nevermind, it works. 18890miki 4 — 1y
Ad

Answer this question