A simple way to respawn players like:
player:respawn()
and with or without static spawn point
player:move_to_spawn()
very needed when you need to move a player away.
like the player "disappear", eaten, maybe move from a protected area...
respawn players?
- SuperStarSonic
- Member
- Posts: 160
- Joined: Fri Oct 14, 2022 20:30
- GitHub: Python-Sargent
- In-game: SuperStarSonic
- Location: Earth (may be out of date)
Re: respawn players?
This would be very helpful, please look into this developers.
- Blockhead
- Member
- Posts: 1688
- Joined: Wed Jul 17, 2019 10:14
- GitHub: Montandalar
- IRC: Blockhead256
- In-game: Blockhead Blockhead256
- Location: Land Down Under
- Contact:
Re: respawn players?
It was already added in 5.6.0-devSuperStarSonic wrote: ↑Wed Dec 13, 2023 02:39This would be very helpful, please look into this developers.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂
- SuperStarSonic
- Member
- Posts: 160
- Joined: Fri Oct 14, 2022 20:30
- GitHub: Python-Sargent
- In-game: SuperStarSonic
- Location: Earth (may be out of date)
Re: respawn players?
why does respawning using player:respawn() keep player velocity? It should reset it, do you know of any workaround?
- Blockhead
- Member
- Posts: 1688
- Joined: Wed Jul 17, 2019 10:14
- GitHub: Montandalar
- IRC: Blockhead256
- In-game: Blockhead Blockhead256
- Location: Land Down Under
- Contact:
Re: respawn players?
I don't know why it does that, but it's not hard to work around. Just set the player's velocity. From a quick look at the docs you can't use :set_velocity() on players, but it's okay, you can get the player's velocity, negate x, y and z, then use :add_velocity().SuperStarSonic wrote: ↑Wed Dec 13, 2023 21:42why does respawning using player:respawn() keep player velocity? It should reset it, do you know of any workaround?
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂
- SuperStarSonic
- Member
- Posts: 160
- Joined: Fri Oct 14, 2022 20:30
- GitHub: Python-Sargent
- In-game: SuperStarSonic
- Location: Earth (may be out of date)
Re: respawn players?
I've fixed it so far by doing this:
Code: Select all
player:add_player_velocity(-player:get_velocity())
Who is online
Users browsing this forum: No registered users and 14 guests