I'm trying to create a small sword fighting area in my game, and I want it to be when you enter the area, it sets a new spawning location so when you die, it spawns you back at a certain location in the area but then when you leave the area, it sets your spawn location back to the main map which will be quite far away.
How am I able to do this?

2 comments
Region3 and the Player.Respawn property can achieve this. Region3: https://developer.roblox.com/en-us/api-reference/datatype/Region3 . Player.RespawnLocation: https://developer.roblox.com/en-us/api-reference/property/Player/RespawnLocation
I usually use CFrames for teleportation