Stopping spawn killers

Hey guys!
I’m creating a shooter game with linear maps, push and pull sort of thing but I have a serious issue; players are getting spawn killed relatively easily

I dont want to use force fields or limit players from sections of the map using invisible walls, so the only way I could come up with is once the player enters the enemy territory they get some message along the lines of “ENTERING ENEMY TERRITORY, RETREAT OR YOU’LL BE KILLED” and then a countdown to when they die.

Now, the only way I could think of doing this is the new OverlapParams api but it also doesnt have an event, meaning I would have to endlessly loop it…
I dont wan’t to use a touched event either because I feel like it would be unreliable, do you guys have any suggestions?

Just change the forcefield “Duration” property which belong to all “SpawnLocation” instances.

Basically, use a block that fills the whole spawn for each team. If someone touched the block and its not on their team, kill them.

I mentioned that I dont want to use a touched event because I think it might come out unreliable as players go in and out of the area

I also mentioned that I dont want to use forcefields

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		humanoid.MaxHealth = 99999
		humanoid.Health = 99999
		task.wait(10)
		humanoid.Health = 100
		humanoid.MaxHealth = 100
	end)
end)

Server script, place inside the ServerScriptService folder.

I didnt mean that I dont want to use forcefields specifically, I meant that I dont want to prevent the player from dying when they spawn for any amount of time

https://developer.roblox.com/en-us/api-reference/function/WorldRoot/FindPartsInRegion3

You can use this to check if a player’s character is in a given Region3 area, if they are then make them invincible.

https://developer.roblox.com/en-us/api-reference/function/WorldRoot/ArePartsTouchingOthers

Alternatively you could make the anti-spawnkill area a large, collisions disabled box and use the above function.

These are replaced by OverlapsParams… obviously if I dont want to use overlaps I wouldnt want to use those either for the same reason

1 Like

you’ll have to. there’s nothing wrong with endless loops, every game has them.
you can also use ZonePlus which has those events that you want, though it also uses the spatial query API under the hood.

1 Like

Region3 it’s what you are searching for

I guess so,
I’m already using it in a loop somewhere for different parts (capturing the hill) but I’ll use a lower rate loop for this.

Thank you

Just make more than 5 spawn locations so the player will spawn in another place and kill the spawn killers

1 Like

Also, to prevent players from camping safe zone, make is so when a player exits the safe zone they can’t go back in.

Already mentioned, I dont want to limit the players using invisible walls.

2 Likes

I have over 10 spawn locations, but the map is linear so it doesnt really help.

oh (30 ch ars)))))))))))))))))))