#team

1 messages · Page 1 of 1 (latest)

bright vault
#

heya, how do i make it so that when someone joins a team and get respawned/refreshed they automatically get "Moderator",

bright vault
#

i knoiw i need a plugin but i dont have the foggiest idea on how i woukld do so

glacial field
#

You'd wanna put this as a ModuleScript in your Config.Plugins and ensure its name starts with Server-
i.e. Server-TeamAdmin or something

bright vault
#
    local server = Vargs.Server
    local service = Vargs.Service

    local Admin = server.Admin
    local TempAdminedThruTeams = {}

    function PlayerRemovingCheck(plr)
        if TempAdminedThruTeams[plr.UserId] then
            Admin.RemoveAdmin(plr, true)
            TempAdminedThruTeams[plr.UserId] = nil
        end
    end

    -- true makes it temporary admin, meaning it's only for this server and doesn't sync across servers
    service.Teams.Judge.PlayerAdded:Connect(function(plr)
        if Admin.GetLevel(plr) >= 1 then
            return
        end -- if they're already a moderator+ elsewhere (this level depends on your settings), don't replace their existing rank
        TempAdminedThruTeams[plr.UserId] = true
        Admin.AddAdmin(plr, "Moderators", true)
    end)

    service.Teams.Judge.PlayerRemoved:Connect(PlayerRemovingCheck)

    service.Players.PlayerRemoving:Connect(PlayerRemovingCheck)
end```
#

Although if that looks like it works my ModuleScript name didn't start with Server- so

#

just ping me

#

@glacial field ^^

#

also Judge is the team im using

#

oh i'm a muffin, the script i made first worked but i just used a deprecated function, thanks