so I have this remote event set up that will allow set people to ban a player by typing their name into a text box. I have this tested and it will kick players but when I try to add the reason it will pop up as "Instance". Why does this happen? I have the value (reason for the kick) set as string.
Again everything is setup and working, it bans players
the script part that bans players is"
local function onKickPlayerEvent(player, string)
player:Kick(string)
end
the localscript past looks like this:
local PlayerToKick = game.Players:FindFirstChild(KickInput)
if PlayerToKick then
KickPlayer:FireServer(PlayerToKick, "You have been kicked by dev")
end
I will be grateful if someone explains this to me :)

3 comments
It’s because you’re currently banning the person who fires the remote. OnServerEvent has a default parameter, the player who called the event. You do not need to specify this in FireServer. Thus, onKickPlayerEvent actually has three arguments, the player who fired the remote, then the player to ban, then the reason. Currently, you’re kicking the player in the first argument.
The first argument in FireServer becomes the second argument in OnServerEvent. This makes the player to ban as the reason. Since the player is an instance, the reason becomes an instance. So to fix this you should make it onKickPlayerEvent(player, playertoBan, reason); playertoBan:Kick(reason).
I put the scripts in a code block.