Hello!
My game that I’m working on is to those of WWE servers, for example: Entrance Practice. I’ve been doing a CleanHandler checks certain things. What the script checks is that if the game is in a private server, if the private server owner is in said private server, if there is a staff in the server, or if the server has no staff and is public.
I worked on this script for a little bit, but I realized my code won’t work for everybody. From the code below, it made it so that if the player is staff, it would print, but with the else statement, it’s going to allow players to use the Clean—a tool where you can damage other players—which would ruin the event me and my cousin made.
Now, would anyone help me figure out how to make it where if an in-game staff member is in a standard server, players that aren’t staff won’t be given the Clean? I’m believing that my script would only make my staff members not have the Clean.
--// Variables
local Players = game:GetService("Players")
local StarterPack = game:GetService("StarterPack")
local Clean = game:GetService("ReplicatedStorage").Gears:WaitForChild("Clean")
local Staff = {3942242726, 1145448158}
--// Script
Players.PlayerAdded:Connect(function(plr)
if game.PrivateServerId ~= "" then
if game.PrivateServerOwnerId ~= 0 then
print("In a VIP server; cleans are handed out by VIP server owner")
else
Clean:Clone().Parent = plr.Backpack
print("In a reserved server; cleans are handed out automatically")
end
else
for i, v in ipairs(Staff) do
if v == plr.UserId then
print("In a standard server with staff; cleans are handed out by staff")
else
Clean:Clone().Parent = plr.Backpack
print("In a standard server; cleans are handed out automatically")
end
end
end
end)