So i'm trying to make an admin panel and I have all of the localscript done and im handling the rest on the server and I have this admin table that shows all the names of the admins but when I go to run the script when I fire the RemoteEvent it shows "Working" 4 times in the console yet the button doesn't do anything and it wont print errors? Here is my code:
Admins = {"Nob", "Elypanft", "GamerPlayesRoblox_YT", "Player1"}
remote = game.ReplicatedStorage.Admin
game.Players.PlayerAdded:Connect(function(player)
for _, v in pairs(Admins) do
if player.Name == v then
game.Players[player.Name].PlayerGui:WaitForChild("Admin").Enabled = true
end
end
end)
function kick(a,b)
game.Players[a]:Kick(b)
end
function freeze(a)
game.Players[a].Character.Humanoid.WalkSpeed = 0
game.Players[a].Character.Humanoid.JumpPower = 0
end
function unfreeze(a)
game.Players[a].Character.Humanoid.WalkSpeed = 16
game.Players[a].Character.Humanoid.JumpPower = 50
end
function admin(a)
Admins.Add(a)
end
function teleport(a, b)
local targetplayer = game.Players[b].Character.HumanoidRootPart
game.Players[a].Character.HumanoidRootPart.CFrame = CFrame.new(targetplayer.Position.X, targetplayer.Position.Y, targetplayer.Position.Z)
end
remote.OnServerEvent:Connect(function(player, cmd, target, reason)
for _, v in pairs(Admins) do -- it loops 4 times here when i want it to loop once
print("Working")
if player.Name == Admins then
if cmd == "Kick" then
kick(target, reason)
end
if cmd == "Freeze" then
freeze(target)
end
if cmd == "Unfreeze" then
unfreeze(target)
end
if cmd == "Admin" then
admin(target)
end
if cmd == "TeleportTo" then
teleport(player, target)
end
end
if not player.Name == Admins then -- checks if a nonadmin fired the remote
game.Players[player]:Kick("Exploiting Admin Panel")
end
end
end)

3 comments
Um. I thought you can only send two things through remote events...... Sending more makes the serverside code break. Also if you are trying to make an exploit... You can't use remote events unless they already existed in the game. Also you kick doesnt have a target. Please show your full code including the server side parts
I'm making my admin panel exploit proof and this is all the serverside stuff
You must be shit at code because my kick works just fine now I fixed it its just i put admins instead of v