Forum > General >

[MISC RELEASE] Private Server Checker

Posts: 1

Threads: 1

Joined: Jun, 2023

Reputation: 0

Posted

THIS IS NOT 100% ACCURATE due to it only checking if you are the only player

 

So this is a Private Server Checker its really simple and im really new to scripting

This has been tested on a free executer

Code:

local playerAmount = 0


function checkServerType(doKick, plrlim, playerAdd)
    for i,v in pairs(game.Players:GetChildren()) do
       playerAmount = playerAmount + 1
       print(v)
    end
    print("Found ", playerAmount, " Players")
    if doKick == true then
        if playerAmount > plrlim then
            if playerAdd == false then
                game.Players.LocalPlayer:Kick("Not Private Server") 
            else    
                game.Players.LocalPlayer:Kick("Player Joined")
            end
        end
    end
end

checkServerType(true, 1, false)

game.Players.PlayerAdded:Connect(function()
    checkServerType(true, 1, true)
end)

  • 0

Posts: 1209

Threads: 68

Joined: May, 2022

Reputation: 17

Replied

so this just kicks you if theres more than an amount of players? you should change the title, a private server checker would check if the current server is a private server not if theres more than x amount of players

  • 0

Did I mention I use arch btw?

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )