Jump to content

Respawn in a xyz point


enzopaul4

Recommended Posts

1 hour ago, LoPollo said:

If you are playing the "play" gamemode, and if i remember correctly, you can edit the spawnpoints. If you ALWAYS want to spawn in a location, delete all spawnpoints and add your own spawnpoint with the coords. Hope it helps :)

i know it for Freeroam , but i try to make my own server (roleplay) and i don't know , but anyway thank you for help :D

Link to comment

If making your own. You'll need to think logically of the process. Think like this:

When do I want to spawn on a location?

On Login, On Dead, ...

Do I want 1 location or multiple?

 

After you've asked yourself these questions Let all those 'events' (onPlayerWasted, ...) Trigger a spawn function using setElementPosition

Link to comment
12 minutes ago, ViRuZGamiing said:

If making your own. You'll need to think logically of the process. Think like this:

When do I want to spawn on a location?

On Login, On Dead, ...

Do I want 1 location or multiple?

 

After you've asked yourself these questions Let all those 'events' (onPlayerWasted, ...) Trigger a spawn function using setElementPosition

Use onPlayerWasted event.

Don't do setElementPosition for spawning, as @ViRuZGamiing said.  

As wiki says on 'setElementPosition': Attention: Do not use this function to spawn a player. It will cause problems with other functions like warpPedIntoVehicle. 
Use spawnPlayer instead.

 

Edited by XeroxMTA
  • Like 1
Link to comment
6 minutes ago, XeroxMTA said:

Use onPlayerWasted event.

Don't do setElementPosition for spawning, as @ViRuZGamiing said.  

As wiki says on 'setElementPosition': Attention: Do not use this function to spawn a player. It will cause problems with other functions like warpPedIntoVehicle. 
Use spawnPlayer instead.

 

Yeah I am typing this on my phone so everything is written by mind not by Wiki. So yeah you'll need a couple of functions. One for the spawn and one for the set location. Although my explanation was More about the theory than the script itself. They way of thinking since that'll get you the furthest.

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...