Kicking yourself from a server (when you're the only Player on it) gives an invalid error

(Posting on behalf of a user who cannot post bugs)
If you’re the only user on a server and you kick yourself, the Disconnected message seems to swap to an invalid state.

Video Demonstration of user kicking themselves from a server where they’re the only one on it:

Isolated invalid error message:

10 Likes

Cannot reproduce, are they kicking themselves from the client or the server?

1 Like

They’re calling the kick api from the server

1 Like

can you give us source code of that kick API?

I was able to successfully reproduce this by kicking myself in both a live server and studio.


The “-1” message seems to occur when no string argument is passed to the kick function. Otherwise the string will render but in both cases the client will momentarily crash. Furthermore, calling a local kick didn’t seem to trigger the bug regardless if any argument was passed. I also tried to disconnect myself by destroying my player instance and it also triggered the bug on both the client, server and studio sessions.

code that triggers Error Code: -1

game:GetService("Players").PlayerAdded:Connect(function(plr)
	task.wait(10)
	plr:Kick()
end)

lol thats so weird! I thought roblox had some default kick message like “you were kicked from this experience reason unspecified” when no string was passed

temp solution: when theres no string to Kick function then pass this string to kick function “unspecified” and then this weird error should go away

something like this would probably fix it

game:GetService("Players").PlayerAdded:Connect(function(plr)
	plr:Kick(typeof(reason)=="string" and reason or "unspecified")
end)

Roblox does have a default message when no string argument is specified. It’s something along the lines of “player service requests player disconnect” on the client and “you have been kicked from the server” on the server. The actual issue is that it’s causing crashes regardless if a string is passed or not, you can also see that the “-1” message also doesn’t have an exit button.

Hey everyone, so sorry for the late response. We have a ticket for this one and we’ll get back to you as soon as we have an update.

1 Like