I was making a kick command for my admin panel and it didn't work. I did not even get an error.
The local script:
local kickEvent = game.ReplicatedStorage.Commands.Kick -- this is for the kick
local target = script.Parent.Player -- this is the target
local reason = script.Parent.Reason -- the reason for a kick, and, ban
local player = game.Players.LocalPlayer -- this is the player on the admin panel
local panel = script.Parent --This is for the admin panel
panel.Kick.MouseButton1Click:Connect(function()
kickEvent:FireServer(player, target, reason)
end)
This is the event script:
local commands = game.ReplicatedStorage.Commands
local playerService = game.Players
commands.Kick.OnServerEvent:Connect(function(player, reason, target)
playerService.target.Text:Kick(reason.Text)
end)
commands.GlobalBan.OnServerEvent:Connect(function()
end)
commands.ServerBan.OnServerEvent:Connect(function()
end)
commands.GiveModItem.OnServerEvent:Connect(function()
end)

2 comments
your code is wrong plus this is not efficient, you dont need to sent the instance as an argument, you can just send the text
also, im pretty sure the text is local so you cant access it from the server