My kick gui only seems to detect my name and not others. I really don't know why nor how to fix it, I'd be really happy if somebody could help me.
Here's the script:
local Button = script.Parent
local ButtonF = Button.Parent
local TextBox = script.Parent.Parent.Parent.KickFrame.KickText
local StarterGUI = game.StarterGui
local GPalyer = game.Players.LocalPlayer
local DebOuncer = false
local Reason = script.Parent.Parent.Parent.ReasonsFrame.ReasonText
--=====--
--Tween--
local TweenS = game:GetService("TweenService")
local TInfo1 = TweenInfo.new(9.99,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0)
local TInfo2 = TweenInfo.new(0.15,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,true,0)
---------
--=====--
Button.MouseButton1Click:Connect(function()
if DebOuncer == false then
DebOuncer = true
for _,PlayerToKick in pairs(game:WaitForChild("Players"):GetPlayers()) do
if PlayerToKick.Name == TextBox.Text then
PlayerToKick:Kick(Reason.Text)
print(PlayerToKick.Name..' was kicked')
TextBox.Text = PlayerToKick.Name..' has been kicked'
TweenS:Create(TextBox, TInfo2, {TextColor3 = Color3.fromRGB(157,255,66)}):Play()
else
TweenS:Create(TextBox, TInfo2, {TextColor3 = Color3.fromRGB(255,30,0)}):Play()
TextBox.Text = 'Player was not found or Player was already kicked'
warn('Name does not exist')
end
wait(.1)
end
ButtonF.ImageColor3 = Color3.fromRGB(255,0,0)
TweenS:Create(ButtonF, TInfo1, {ImageColor3 = Color3.fromRGB(80,179,255)}):Play()
wait(9.99)
DebOuncer = false
end
end)
The script is located in a "LocalScript" and it activates once the player click the "Kick Button"

3 comments
The script seems to only kick one person at a time. When you enter their name, it is case sensitive.
This might be happening because you aren't firing any RemoteEvents to kick the player from the server, so the LocalScript is probably detecting the other players, but everything happening is only client sided.
Are there any errors?