"Kicked due to unexpected client behavior error 268" - Under what conditions does this occur?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    We need more technical information about the conditions under which the platform auto-kicks players with the message “Kicked due to unexpected client behavior, Error: 268”. We, the developers of the game “Worms” have been trying to debug this problem which is happening to our players for over 2 months, and do not have sufficient technical information from Roblox to find the root cause.

  2. What is the issue? Include screenshots / videos if possible!
    The Roblox client auto-kicks players with the message “Kicked due to unexpected client behavior, Error: 268” at random times, it seems like it can happen when they are digging in Terrain, but not always. It has been occurring frequently to our players (and our devs when playing the game) for over 4 months.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    We have searched developer hub, so, google etc. Found one previous post that was closed as “Fixed”.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Our game makes heavy use of dynamic terrain modification (for digging). Is it possible that Terrain replication conflicts could be causing this, for example in a game that has been running for a while with heavily modified Terrain having to sync newly connected client state?

4 Likes

To my knowledge 268 points to the program being modified in a certain aspect. I assume it’s memory address related. It could be caused by an FPS unlocker or you having a game overlay that injects a DLL into the game.

What kind of client scripts do you have, is the anything you’d consider pretty advanced? Do you attempt to modify the game in any way? You can reinstall ROBLOX and try again.

Also if it’s game specific, have a engineer help you.

2 Likes

This error occurs to your pc having malicious files doing something with roblox,

  1. Make sure you run your antivirus (maybe some hackers stored something somewhere in your pc)
  2. Don’t use any exploits as they cause this error aswell
  3. Re-Install roblox if this still occurs

Hope i helped!

2 Likes

Thank you for the suggestions, but this is happening to too many of our players including clean dev machines that have no exploits installed on them. It also occurs on desktop, tablet and phone devices. The game contains numerous advanced scripts developed in-house. There is some condition occurring which is making the engine think an exploit is being used. What are the specific things that trigger this error?

1 Like

Sadly then i don’t know the issue, you might have a virus in your game or a script that’s doing something.

I had unspecified cheating program to have speed hack in Geometry Dash, when i removed it Roblox stopped kicking me, if you have it also, it may be occured by this.

  • Hope you find solution!

Although we still don’t have any additional information on the specific conditions that this error will occur, we have fortunately been able to eliminate it occurring.
Using the Server micro profiler against live servers and capturing many log snapshots, we found that there were times that the main game loop would go above 30% cpu. We created a task manager and converted several scripts that were spawn()ing “threads” to instead use co-routines, and added debug profile begin/end calls to capture timings… after implementing all this and by process of elimination removing some of the threads, we narrowed the problem down to a condition where a busy loop could occur within an event handler. After fixing that problem, players have no longer been reporting the problem occurring… so it appears that if the server gets too overloaded for some reason, it can trigger the clients to be kicked for “unexpected client behavior”, even though the root cause of the problem is actually server-side.

8 Likes

You can try cleaning your code a bit to use less memory.

We also thought maybe it was occurring because of high memory use, but we reduced memory use on low-end devices by implementing streaming, and the “kicked for unexpected client behavior” problem was still occurring.

2 Likes

Well, I can’t say more than that because I don’t know anything big about the exploiting world.

Okay, Press Windows+R then type in run %appdata% from roaming go back to the appdata folder. Now go to local find ROBLOX then delete AnalyticsSettings, frm.cfg and GlobalBasicSettings. This should fix your issue. If you have any problem tell me.

1 Like

It was unable to fix it. I just tried it. Is there another way?

3 Likes

I’m also being kicked for this and already tried every step suggested, I cannot create my own topic on the devforum so I made a comment here.

I emailed roblox but they’re only given me the same steps I’ve suggested and also linked this page and another one I checked, hopefully this can be fixed or someone has other suggestions on how they fixed it?

The server keeps separate copies of functions connected to remote events for every player. Consider how a PlayerAdded function works for every player, yet multiple people can join the server at the same time because they have their own version of that function, same thing with remotes. What I assume is happening is something like this (will eventually crash studio, or give the same error you see?):
Client

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("RemoteEvent")

while true do
	remote:FireServer(1)
	task.wait()
end

Server

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage.RemoteEvent
local testValue = 0
local timeEnd = 0

local function RemoteReceived(player, value)
	while true do
		if game.Workspace:GetServerTimeNow() >= timeEnd then
			timeEnd = game.Workspace:GetServerTimeNow() + 1
			print(testValue)
		end
		testValue += value
		task.wait()
	end
end

remote.OnServerEvent:Connect(RemoteReceived)

Basically a memory leak for a specific player.

This is purely speculative, but the server probably kicks players if the amount of resources devoted to that specific player exceeds a certain threshold. This is a better option rather than attempting to pick which threads to send to garbagecollector heaven; or even worse, letting the whole server crash because of a single player.

If this is what’s causing the error, then the fix is simple: try not to use while loops in event handlers. If a loop within an event handler is needed, then add a debounce and always make sure they can terminate. If an event handler is only needed to capture a single event, then call :Disconnect() on that event and :Connect() if it’s needed again.

2 Likes