Nope, still didn’t kicked…
A
Nope, still didn’t kicked…
A
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
for _,v in pairs(exepct) do
if username.Text:lower():match(v:lower()) then
print("Exception for "..v)
return
end
end
print("You kicked "..username.Text.." for "..reason.Text or "an unknown reason given")
if reason.Text == "" then
local victim = game.Players:FindFirstChild(username.Text)
if victim then game:GetService("ReplicatedStorage").KickPlayer:FireServer(victim, "An unknown reason given") end
else
local victim = game.Players:FindFirstChild(username.Text)
if victim then game:GetService("ReplicatedStorage").KickPlayer:FireServer(victim, reason.Text) end
end
end
end)
Adding on to that, I understand what you mean by “username for short”, so this might help.
Thank you @SubtotalAnt8185 !
I really appreciated !
Now for the hardest part (I guess), The Username for short not cloning…
I’m not exactly sure what you meant by that, but I’ll do my best to help.
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.Activated: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
local plr
for _, obj in pairs(game.Players:GetPlayers()) do
if obj.Name:lower():match(username.Text:lower()) then
plr = obj
break
end
end
if plr then
for _,v in pairs(exepct) do
if username.Text:lower():match(v:lower()) then
print("Exception for "..v)
return
end
end
print("You kicked "..username.Text.." for "..(reason.Text~="" and reason.Text) or "an unknown reason given")
if reason.Text == "" then
game:GetService("ReplicatedStorage").KickPlayer:FireServer(plr, "An unknown reason given")
else
game:GetService("ReplicatedStorage").KickPlayer:FireServer(plr, reason.Text)
end
end
end)
I did this before when developing a very early version of BaseAdmin, but there might still be a few issues with the code. It should work, though.
It worked before, and here, it’s working too, so, i prefer the old one that you posted…
I did fix a few other things in the new one like the print statement. The new one also doesn’t require you to type out their whole username.
Alright, my script is good, now…
I decided to read your script again.
When you’re kicking the player, you still have your LocalPlayer.Kick() from possible testing.
If you don’t want the player kicking to get kicked, replace this:
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
…with this:
if game.Players:FindFirstChild(username.Text) then
print("You kicked "..username.Text)
game.ReplicatedStorage.KickPlayer:FireServer(username.Text, reason.Text)
end
Let me know if it helped or not!
That’s not the case, @SubtotalAnt8185 helped me…
You shorten the script alot more and that’s not i wanted…
Also, look at the issue, it’s solved !
Here:
Link to the guy who helped:
I still have the Username for short not cloning…
Please help me…
New script but the username won’t clone…
local plr = game.Players
local plrname = plr.Name
local button = script.Parent
local buttonUSERNAME = button.Parent.Parent.Username
plr.PlayerAdded:Connect(function()
plr.Name = button:Clone(plrname)
script.Parent.Text = plrname
end)
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.Parent.Username.Text == "" then
script.Parent.Name = script.Parent.Parent.Parent.Username.Text
end
end)
It’s fixed, I think. If there’s any issues, please DM me.