Hello guys once for all, I found 2 issues.
- Usernames for short not cloning.
- Admin being kicked as an exception.
So, I tried to make an AdminPanel with the kick button, username, reason, username for short and the reason for short.
Usernames that are admins:
- kdopdaux1803 (Me).
- 4667Hp
- LoukaTigre_ps3
These are all the users that have access to have an admin…
Recently, I made a Reason Click and it worked 1st try but with the users, nope.
LocalScript (1):
local usernameclick = script.Parent.Parent.Parent.Username
game.Players.PlayerAdded = script.Parent:Clone().Name
-- Put anything after: game.Players.PlayerAdded = script.Parent:Clone().Name + help me to fix: game.Players.PlayerAdded = script.Parent:Clone().Name (Sorry if it's the same one).
LocalScript (2(Before):
local username = script.Parent.Parent.Username
local reason = script.Parent.Parent.Reason
local Player = game:GetService("Players").LocalPlayer
local exepct = {"kdopdaux1803","4667Hp","LoukaTigre_ps3"}
script.Parent.MouseButton1Click:Connect(function()
if username.Text:gsub("%s", "") == "" then
warn("You must supply a username before kicking.")
return
end
if not game.Players:FindFirstChild(username.Text) then
warn("There is no Player named \""..username.Text.."\" in the server!")
return
end
if game.Players:FindFirstChild(username.Text) then
print("You kicked "..username.Text)
game.ReplicatedStorage.KickPlayer:FireServer(username.Text, reason.Text)
game.Players.LocalPlayer:Kick(reason.Text)
if reason.Text == "" then
game.Players.LocalPlayer:Kick("Unknow reason given.")
else
game.Players.LocalPlayer:Kick(reason.Text)
end
end
end)
LocalScript (2(After):
local username = script.Parent.Parent.Username
local reason = script.Parent.Parent.Reason
local Player = game:GetService("Players").LocalPlayer
local exepct = {"kdopdaux1803","4667Hp","LoukaTigre_ps3"}
script.Parent.MouseButton1Click:Connect(function()
if username.Text:gsub("%s", "") == "" then
warn("You must supply a username before kicking.")
return
end
if not game.Players:FindFirstChild(username.Text) then
warn("There is no Player named \""..username.Text.."\" in the server!")
return
end
if game.Players:FindFirstChild(username.Text) then
print("You kicked "..username.Text.." for "..reason.Text or "an unknow reason given")
game.ReplicatedStorage.KickPlayer:FireServer(username.Text, reason.Text)
game.Players.LocalPlayer:Kick(reason.Text)
if reason.Text == "" then
game.Players.LocalPlayer:Kick("Unknow reason given.")
else
game.Players.LocalPlayer:Kick(reason.Text)
end
end
for i,v in pairs(exepct) do
-- Add anythnig in here !
end
end)
-- Starting to here, the Admins can be kicked.
if exepct == true then
script.Parent.Parent["Username for short"].Username.Visible = false
end
Warning, it’s a different script then the other one
Videos:
Bug of the issue:
So yeah guys any help is appreciated.
The 1st one you have to reload the full script or add lines + fix the issue and the 2nd one, you have to add stuff on it.