Is this possible: Spawn Zone idea, Questions

I hope this is a good/right place for this post

Hello! [This is a long post but I needed to get my idea out in full]

So I’m making this post because I want to get an idea if what I’m going to talk about is possible. I’m not working on this this yet, wont be for a while, it’s just an idea I had for my future game, if and when im actually able to do it.

The subject I will be talking about would fall under Spawns, and saving the location etc.

Game overview
A story based single player game where you progress through a map while doing storyline stuff, side quests, treasure hunting etc. You will be able to go to previously explored areas essentially being open world but story requires you to progress through the map, and or inorder to progress you got to do the story

The Idea and topic at hand
I want it so that when a player leaves the game and comes back and after navigating the menu pressing play, they Spawn in the last area they were in. I know this part is possible because before making this post I did look into it some and found videos on saving location data. However that’s just the last spot the player was standing before they left.

But this also has to be a Spawn area if the player dies for whatever reasons

My thinking is breaking the map up into zones, indicated by invisible parts or something similar to how sound zones are done. Once a player enters a zone it detects they are in it and saves them to that zone, in each zone there are Spawn points, or check point like things.

Now the player also needs to be able to spawn on these points if they die (undecided on how this aspect will be in terms of the overall game, could be some enemy or environmental, but also want to have some platforming in it).

An example I can think of is say a player enters a zone that consists of a platforming section or a puzzle they got to do, they get past one section of it and fail on the next, instead of going back to the start they do in the “middle” (in this example) now I know that’s possible because of obeys, but in this general overall idea could it work, maybe each part of a puzzle could be a new zone.

Or they are going through part of the story and fail a section and have to respawn, they go back to sayba checkpoint before they got to the point they failed at

An example I can think of is both Rise and Shadow of the TombRaider, where my inspiration comes from. Any one who played those games might be able to get an idea where I’m coming from with this.

I definitely don’t want to over complicate it, I do think it’s possible to a degree, when I think of it it does seem like a achievable concept. Even though I’m still in beginner stages of coding (yes and I’m thinking about this big game idea, don’t worry I’m not going to fully pursue it right of the bat, I know I got to do other stuff first and be comfortable with my skill level, i just want to get ideas)

I can already see how it could be layed out,
Physical zones
Zone 1 (name of location
Zone 2 (name of location)

Script side example

Local Zone1 = “location where it’s stored” etc

I won’t go into full because I’m not sure of it all obviously, but the concept of it does seem doable but this is Roblox what might seem doable might not be possible, hence me making this post for feedback or to gather information regarding this. When I was trying to find things, it either was for obbys or other things that really wasn’t what I was looking for, except the type of videos mentioned in this post, which will help to a degree.

If you made it this far thanks for reading, I hope it made sense

Just bumping this… Im actually wanting to do a basic thing similar to this sooner

Yes, it is possible to create a “Spawn Zone” in Roblox, which is an area where players can respawn after they die or are otherwise removed from the game. Here is an example of how you might create a Spawn Zone .

First, you will need to create a part in the game world that will serve as the Spawn Zone. This can be done by inserting a new Part object into the game and positioning it where you want the Spawn Zone to be. You can set the size and shape of the Spawn Zone by adjusting the properties of the Part object.

Next, you will need to create a script that will handle the spawning of players within the Spawn Zone. This script could be attached to the Part object you created, or to some other object in the game world. Here is some example code that demonstrates how you might handle player spawning in a Spawn Zone.

-- Find the Spawn Zone part in the game world
local spawnZone = game.Workspace:FindFirstChild("SpawnZone")

-- Create a function to handle player spawning
function onPlayerSpawn(player)
    -- Set the player's character to a new, default character
    player.Character = game.ReplicatedStorage.Characters:FindFirstChild("Default").Clone()

    -- Teleport the player to the Spawn Zone
    player.Character:MoveTo(spawnZone.Position)
end

-- Connect the function to the PlayerAdded event
game.Players.PlayerAdded:Connect(onPlayerSpawn)

This code will create a function called onPlayerSpawn that is called whenever a new player joins the game. The function will create a new character for the player, based on a default character that you have created in the game, and will then teleport the player to the Spawn Zone. You can customize this code to suit your specific needs and requirements for your game.

To set up a Spawn Zone in your game , you will need to follow these steps.

  1. Insert a Part object into your game world that will serve as the Spawn Zone. You can do this using the InsertService
local part = Instance.new("Part")
part.Name = "SpawnZone"
part.Anchored = true
part.Size = Vector3.new(20, 20, 20)
part.Position = Vector3.new(0, 0, 0)
part.Parent = game.Workspace

This code will create a new Part object with the name “SpawnZone” and insert it into the game world at the origin (0, 0, 0). You can adjust the size and position of the Spawn Zone by modifying the Size and Position properties of the Part object.

  1. Create a script that will handle the spawning of players within the Spawn Zone. This script could be attached to the Part object you created, or to some other object in the game world. Here is some example code that demonstrates how you might handle player spawning in a Spawn Zone.
local spawnZone = script.Parent

function onPlayerSpawn(player)
    player.Character = game.ReplicatedStorage.Characters:FindFirstChild("Default").Clone()
    player.Character:MoveTo(spawnZone.Position)
end

game.Players.PlayerAdded:Connect(onPlayerSpawn)

This code will create a function called onPlayerSpawn that is called whenever a new player joins the game. The function will create a new character for the player, based on a default character that you have created in the game, and will then teleport the player to the Spawn Zone.

  1. Customize the code to suit your specific needs and requirements for your game. For example, you may want to set the default character that is used for spawning to be a different character, or you may want to set the Spawn Zone to be a specific location in your game world.
  2. Test your Spawn Zone by starting a game and adding players to see if they are spawning correctly in the designated area. If you encounter any problems or errors, you can use the Roblox output window to help troubleshoot and debug your code.

Cool, that might help give me a better idea what’s possible, only thing is its not exactly just a spawn zone you typically see in roblox games

there is more to it. Might be hard to explain, but the game idea is kinda complex, and a single player story based openworld adventure game.

Like mentioned its similar to checkpoints, but you don’t go and touch a spawn point to be in that area. Similar to the 3 newer TombRaider games or games similar to style.

However once I get to that stage and have a better knowledge it might be more easier to think of. I was just testing the water to see what others had to say about it

Certainly! It sounds like you have a clear idea of what you want your Spawn Zone to do in your game. You can customize the code I provided to suit the specific needs of your game. For example, you can use the onPlayerAdded event to trigger the spawning of players in the Spawn Zone, rather than relying on the player to touch a specific object in the game world.

You can also use the onPlayerAdded event to trigger other actions in your game, such as displaying a loading screen or initializing the player’s character. Additionally, you can use the onPlayerRemoving event to trigger actions when a player leaves the game, such as saving their progress or cleaning up any resources that were associated with their character.

I hope this helps you get started with implementing a Spawn Zone in your game. If you have any further questions, don’t hesitate to ask!

1 Like

lol why not ask chatgpt

but if you can’t then yes you could implement a spawn zone with suggested code above

You can set a player’s spawnpoint with Player.RespawnLocation.

For dividing the map into zones, look into the ZonePlus module: ZonePlus v3.2.0 | Construct dynamic zones and effectively determine players and parts within their boundaries

So some combination of “when Player enters a zone, set Player.RespawnLocation to this SpawnLocation instance” should achieve what you want.

1 Like

I take it that persons respons was just code from a ai generator? Man that’s just sad, now im skeptical on even asking for future help with my code etc, i didn’t even know, thanks for pointing that out.

Ill definitely check put that link, looks like it might be something i am looking for