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

Trying to script a group auto assign team for a game. How can I do this?

Asked by 4 years ago

I am trying to script a team auto assign to my game and that it would put you in the team of your rank. Although I am also trying to make the option for a raider and visitor choose able but It always doesn't work when I watch tutorials, try it for myself and read forums on it. It is taking hours! Please help!

1 answer

Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
4 years ago

Hello be sure to read the things that i say in the script it's important for usage, but here you go:

be sure to disable the AutoAssignable property off cause then it will randomly give a team to a user

local groups = {
[0000] = "TeamNameHere",    -- insted of the 0000 add ur groups id
[2951985] = "Team2"
}

game.Players.PlayerAdded:Connect(function(player)
    for ids,team in pairs(groups) do
        if player:IsInGroup(ids) then
            player.Team = game.Teams[team]
        end
    end
end)

If worked please accept, thank you

0
Yea, it is sort of working but I am trying to figure out how put in the group ranks too. Thanks anyways! realLukasgamertv 2 — 4y
Ad

Answer this question