I make script that specifying owners of vip server… that make them use the command on vip server whats wrong in this script?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local commands = ServerStorage.VipCommands
if game.PrivateServerOwnerId ~= "" and game.PrivateServerOwnerId ~= 0 then
Players.PlayerAdded:Connect(function(Players)
local Vip = game.PrivateServerOwnerId ~= "" and game.PrivateServerOwnerId ~= 0
local prefix = "/" -- Change this to the starting character
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(message)
if not table.find(Vip, Player.Name) then return end
if message:sub(1, #prefix) ~= prefix then return end
local args = message:split(" ")
local cmd = args[1]:sub(#prefix + 1, #args[1]):lower()
table.remove(args, 1)
if not commands:FindFirstChild(cmd) then return end
spawn(function()
require(commands[cmd]).run(Player, message, args)
end)
end)
end)
end)