So then, Im making a loader for a admin panel which im selling, i making it whitelisted to stop leaks but Im making a loader for it but when i do the command !adminpanel it isnt showing up, and when i look in PlayerGui Doesn’t show the screen gui i made
Code:
function findPlayer(msg)
local msg = msg:lower()
for _, v in pairs(game.Players:GetPlayers()) do
local name = v.Name:lower():sub(0, msg:len())
if name == msg then
return v
end
end
return nil
end
local module = {}
--Just stuff here to check if player has a license
module.load()
function module.load()
local GUI = script.AdminPanel
local Event = script.SimpleServiceEvents
Event.Parent = game.ReplicatedStorage
local ServerLock = false
Event.OnServerEvent:Connect(function(Player, Type, args)
if Type == "Kick" then
local plr = findPlayer(args["Player"])
plr:Kick(args["Reason"])
elseif Type == "ServerLockEnable" then
ServerLock = true
elseif Type == "ServerLockDisabled" then
ServerLock = false
end
end)
game.Players.PlayerAdded:Connect(function(plr)
local CGUI = GUI:Clone()
CGUI.Parent = plr.PlayerGui
plr.Chatted:Connect(function(msg)
if msg == "!adminpanel" then
CGUI.MainFrame.Visible = true
end
end)
if ServerLock == true then
plr:Kick("Server Lock Enabled!")
end
end)
end
return module