I made an admin panel script which does The Following:
1-when the player press The Trriger Button
2- it fires a remote_event in RP_Storage With some paramters (Like Textbox Text)
3- and there is a server_script that Detects when The remote_Event is fired and does The following:
The Local Script:
script.Parent.MouseButton1Click:Connect(function()
local TextR = game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox").Text
local TextMs = game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox2").Text
local TextK = game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox3").Text
local TextH = game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox4").Text
local TextS = game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox5").Text
local Button2 = game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox").Text
game.ReplicatedStorage:WaitForChild("RemoteEvent"):FireServer(TextR,TextMs,TextK,TextH,TextS)
if game.Players.LocalPlayer:GetRankInGroup(1234) ~= 255 then
print("This Gui owner does not Have The Acciplity To Use Secret Commands")
elseif game.Players.LocalPlayer:GetRankInGroup(1234) == 255 or game.Players.LocalPlayer:GetRankInGroup(1234) == 2 then
print("initiating The Secret Commands")
game.Players.LocalPlayer.PlayerGui.ScreenGui_S:WaitForChild("Frame"):WaitForChild("TextBox5").Visible = true
end
end)
The Server_Script:
game.ReplicatedStorage:WaitForChild("RemoteEvent").OnServerEvent:Connect(function(player ,TextR, TextMs, TextK, TextH, TextS)
for _,Item in pairs(game.Players:GetChildren()) do
if Item.Name == TextR and Item:GetRankInGroup(1234) ~= 255 then
Item:Kick(TextMs)
print("Player: "..Item.Name.." Got Kicked")
elseif Item.Name == TextR and Item:GetRankInGroup(1234) == 255 then
print("kicking The owner?")
end
end --end For player loop
for _, Item in pairs(game.Workspace:GetChildren()) do
if Item.Name == TextK then
local hum = Item:FindFirstChild("Humanoid")
local Char = hum.Parent
local Achivet_Player = game:GetService("Players"):GetPlayerFromCharacter(Char)
if hum and Achivet_Player:GetRankInGroup(1234) ~= 255 and Achivet_Player then
hum.Health = 0
print(Achivet_Player.Name)
elseif hum and Achivet_Player:GetRankInGroup(1234) == 255 and Achivet_Player then
print("You Cant Kill The owner")
end
end -- end of the Kill Loop
and here is the error:
and For Some Reason i tryed it with The same exact Script But in Diffrent Place
and it somehow worked