Is there a way to detect if a player has crashed?

Some things which are done on the client break down replication in undefined ways. For example, in the HRP example, the player would stay anchored on the client but fall on the server. Then, the two data replications would conflict and cause the server to crash.

There is no single fix as to what suggests this problem. However, after some thought, it doesn’t seem to be the same problem as what is shown in the videos you showed. The videos you showed simply show server/client mismatch, which is normal.

I’ll have a think and see if I can think of another thing which could cause this. However, in the meantime, please can you post the code you use for tasks relating to the build creation, and any code you think likely to cause these crashes.

1 Like

I dont think any of the code causes the server to crash, Since its done about 0.1 second before the playerremoving event is fired, And adding a waittime after the print still does not make the output appear.

The localscripts change the properties of the constraints.

Also i did notice that weldconstraints cause a LOT of lag for the client when they are used on large creations, And there are weldconstraints stored inside of the motor for the lockmode, But not enabled in the video’s. (Im not sure if this also causes server lag.)

This would never crash the server. Replication breaks but the server is fine.

If player constructions contain lots of unanchored and constrained physics objects I am fairly confident that this is related to physics and network ownership.

Try attemping to crash the server but make it so the player has very few or no parts to save, this way you can start narrowing down the possible areas of conflict.

Also try commenting parts of your code out to see if you can isolate the problem from normal code

I found out by removing the saving part that if you save before removing the spawned creation, The ingame server freezes once the player is leaving.

I have swapped the 2 lines and now everything is working perfectly.

Is it possible to see the area of code where you swapped those lines.
A before and after would be very nice.
It may help someone else if they get similar symptoms.

2 Likes
-- Save via a modulescript
pcall(function()
	if SessionData[Player.Name].AutSave == true and #(SessionData[Player.Name].BuildAircraft:GetChildren()) > 2  then
		SessionData[Player.Name].SlotAuto = {}
		SessionData[Player.Name].SlotAuto.Name = "AutoSave"
		SessionData[Player.Name].SlotAuto.Craft = require(game.ServerStorage.ServerModules.AircraftSaveLoadModule).SaveAircraftToTable(Player)
	end
	SaveData(Player)
end)

-- Destroy spawned in aircraft.
if SessionData[Player.Name].FlightAircraft then
	for i,h in pairs(SessionData[Player.Name].FlightAircraft:GetChildren()) do
		if h.Name == ("Rocket") then
			if h:FindFirstChild("FirstTime") and h.FirstTime.Value ~= nil then
				h.FirstTime.Value:Destroy() -- rockets stay when the player leaves in flight mode
			end
			h:Destroy()
		end
	end
	SessionData[Player.Name].FlightAircraft:Destroy()
end

The examples which are shown above cause the server to crash.
The flightaircraft somehow affects saving while nothing requires it in the script, And savedata() only setasync’s.

I have swapped the 2 lines and the issue is fixed now!

2 Likes