Hello, I am trying to make a admin panel. The issue is my script won’t kick players when it should and is not giving errors.
Client Side:
local PanelFrame = script.Parent.PanelFrame
local AnnouncementText = script.Parent.PanelFrame.AnnouncementText
local UsernameText = script.Parent.PanelFrame.UsernameText
local ReasonText = script.Parent.PanelFrame.ReasonText
local SendAnnouncement = script.Parent.PanelFrame.SendAnnouncement
local Kick = script.Parent.PanelFrame.Kick
local Ban = script.Parent.PanelFrame.Ban
local Unban = script.Parent.PanelFrame.Unban
local Warn = script.Parent.PanelFrame.Warn
local GroupRank = script.Parent.PanelFrame.GroupRank
local Players = game:GetService(“Players”)
local LocalPlayer = Players.LocalPlayer
local KickInfo = game.ReplicatedStorage:WaitForChild(“Kick”)
local WarnInfo = game.ReplicatedStorage:WaitForChild(“Warn”)
local KickUsername = UsernameText.Text
local KickReason = ReasonText.Text
local Group = “10880254”
GroupRank.Text = LocalPlayer:GetRoleInGroup(Group)
Kick.MouseButton1Click:Connect(function()
KickInfo:FireServer(KickUsername, KickReason)
end)
Server Side:
local Kick = game.ReplicatedStorage:WaitForChild(“Kick”)
local Warn = game.ReplicatedStorage:WaitForChild(“Warn”)
Kick.OnServerEvent:Connect(function(Username, Reason)
local PlayerToKick = Username
PlayerToKick = game.Players:FindFirstChild(PlayerToKick)
if not PlayerToKick or not PlayerToKick:IsA(“Player”) then
return
end
PlayerToKick:kick(’\nHSH - Disconnected\nYou have been kicked from the server\nReason:\n’…Reason)
end)