I did the script differently…
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
game.Players.PlayerAdded:connect(function(player)
for i, v in pairs(exepct) do
if player.Name == v then
-- Add anything in here !
end
end
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
local victim = game.Players:FindFirstChild(username.Text)
if victim then victim:Kick("Unknown reason given.") end
else
local victim = game.Players:FindFirstChild(username.Text)
if victim then victim:Kick(reason.Text) end
end
end
end)
And it still kicked me out of the game !!1!!!