--//Variables
local AdminModule = require(game:GetService("ReplicatedStorage").AdminModule)
--//Main
game.Players.PlayerAdded:Connect(function(player)
--//Variables
local PlayerGui = player.PlayerGui
local AdminPanel = PlayerGui:WaitForChild("AdminPanel",7)
local Main = AdminPanel.Main
local PlayerData = Main.PlayerData
local MainFunctions = Main.MainFunctions
local Playerlist = Main.Playerlist
--//Admin Checking & Handling
if AdminModule.checkAdmin(player.Name) == true then
MainFunctions.ResetData.MouseButton1Click:Connect(function()
local PlayerSelected = AdminModule.getSelected(player)
if PlayerSelected == nil then
print("Player has not been selected!")
else
game.Players[PlayerSelected].PlayerData.Level.Value = 1
game.Players[PlayerSelected].PlayerData.XP.Value = 0
game.Players[PlayerSelected].PlayerData.NeededXP.Value = 1000
game.Players[PlayerSelected].PlayerData.Money.Value = 0
game.Players[PlayerSelected].PlayerData.Rebirth.Value = 0
game.Players[PlayerSelected].PlayerData.XPRate.Value = 1
wait(1)
game.Players[PlayerSelected]:Kick("Your data has been reset for various reasons. Please rejoin!")
end
end)
MainFunctions.AdminTool.MouseButton1Click:Connect(function()
--don't really got an admin tool exdee
end)
MainFunctions.Shutdown.MouseButton1Click:Connect(function()
for i,v in pairs(game.Players:GetChildren())do
v:Kick("Server has been shutdown. Please rejoin!")
end
end)
MainFunctions.KickPlayer.MouseButton1Click:Connect(function()
local PlayerSelected = AdminModule.getSelected(player)
if PlayerSelected == nil then
print("Player not selected")
else
game.Players[PlayerSelected]:Kick("Kicked by an admin!")
end
end)
Main.PlayerData.AdminTool.MouseButton1Click:Connect(function()
--ignore this
end)
else
player:Kick("You shouldn't have access to this panel. If you found a bug, please report it for possible in-game items!")
end
end)
Basically, it doesn't work in-game. I'm trying to make an admin panel but now it doesn't work. Everything works fine on Studio but not in-game. The game is FE, so maybe that's a problem? If so, how would I make this compatible with FE. This is a server script in ServerScriptService. I know I could use Remote Events but I feel it's not that safe... I wanna have it serverside

2 comments
what you should do is use Remote Events and runthe MouseButton1Click events in gui in a local script.
Yes, but it's an admin panel type thing. I wanna do it serverside...