Anti-Spawn Killing System Randomly Removes Forcefield - How do I fix it?

I would say that my studio’s game is a pretty decent game. However, a big issue with it, has been trying to get its retention and playtime stats up:


They are just under the benchmark, and if we were in the benchmark, I assume we would have better discoverability and therefore more CCU.

There are a million ways to improve retention and average play time, some of them being things we added to the game, but I think something that would greatly improve these stats, especially playtime, would be fixing the game’s anti-spawn kill system. Makes sense, a new player that gets spawn camped over and over again is not going to come back, much less play long.

Currently, we have an infinite forcefield system, that only goes away if the following occur:

  • As you can see above, we have invisible walls that surround the base(s), that serve as boundaries. If a player crosses these boundaries, the forcefield is removed.
  • If a player equips a tool of any sort, the forcefield is also removed as well.
  • There is a fallback protocol where, if, somehow, someway, someone was able to leave their base and use a weapon to kill another player while they had a forcefield, they would be checked for a forcefield, and have it removed.

The code for this is below:

--- below line is inside the code that handles kills
local ff = killer.Character:FindFirstChildOfClass("ForceField"); if ff then ff:Destroy(); end;

---below lines/functions are inside a character added function
local DeleteFF; DeleteFF = Head.Touched:Connect(function(hit)
			if not hit or not hit.Parent then return; end;
			local ff = char:FindFirstChildOfClass("ForceField"); if not ff then return; end;
			if hit.Parent.Name ~= "antiSKSystem" then return; end;
			ff:Destroy();
			DeleteFF:Disconnect();
		end);
local DeleteFF_Tool; DeleteFF_Tool = char.ChildAdded:Connect(function(tool)
			if not tool:IsA("Tool")then return; end;
			local ff = char:FindFirstChildOfClass("ForceField"); if not ff then return; end;
			ff:Destroy();
			DeleteFF_Tool:Disconnect();
		end);

With the forcefield being removed past a certain bounds, there seems to be an issue where, if you spawn, the forcefield is very short, if not never appears. It is not common, but it is frequent enough that I get a fair amount of reports about it. The duration of forcefields in the bases is set to be 10 minutes.

How do I fix this?

I just had this happen to me in my game right now. I was just hanging inside my base, no weapons or anything, and it removed the forcefield.

1 Like