Giving Admin Commands To Owners of a VIP Server

Hi, Not Sure If This is the Right Category for this but I’ll Ask Anyway.
I’ve got a game Where People Drive Trains at a level crossing. People Like to Cause Problems by Derailing this trains. I’ve Enabled the Feature of Free VIP Servers but I Would Like Players to Receive Admin Commands When They Claim Their Free VIP Server.

I’m Not Experienced At All In Scripting but The Admin Commands Module I’m Utlising is Kohls Admin Infinite.

Any Help Would Be Appereicated :slight_smile:

1 Like

You will first need to get the OwnerId (or something like that, I can’t remember). Then, you need to make a function that checks if a user is the owner of a vip server and are able to view the commands.

The following is a code directly from the api reference website. You need to put this code inside the ‘Admin command setting’ script.

local Players = game:GetService("Players") 
-- is this a VIP server?
if game.PrivateServerId ~= "" and game.PrivateServerOwnerId ~= 0 then 
    -- listen for new players being added
    Players.PlayerAdded:Connect(function(player) 
        -- check if the player is the server owner
        if player.UserId == game.PrivateServerOwnerId then
            print("The private server owned has joined the game")
            -- This is where you would insert the player to admin list
            -- Eg: table.insert(AdminList, player.Name)
        end
    end)
end

10 Likes

Where on earth do you put it? I have actually no clue where on earth the “Admin Command Setting” Script is.

4 Likes