Can someone tell me what is wrong with this script (admin script)

Hey This is the whitelist script for my custom admin it has a module script under the serverscript which is the text below.

local commands = script:WaitForChild('Commands')

local cmds = require(commands)
local prefix = '%'

game.Players.PlayerAdded:Connect(function(player)
    if player.UserId == 123400007 or 575085097 then
    player.Chatted:Connect(function(message)
        message = string.lower(message)
        local sp = string.split(message,' ')
        local command = sp[1]
        if command:sub(1,1) ~= prefix then return end
        if cmds[command:sub(2,#command)] then
            cmds[command:sub(2,#command)](player,sp)
        end
        end)
    else return
    end
end)

If someone can tell me how to fix this and make it where only those certain UserID’s can use the admin it would be cool thanks.

You also need “player.UserId ==” when you’re trying to complete the “or” statement

if player.UserId == 123400007 or player.UserId == 575085097 then

1 Like

Thanks man fixed it :+1: 30char30char30char

1 Like