[FREE][Standalone] HQLY: Teleport To Ground

:beginner: Info

  • A nice little script I wrote that I find helps those with lower end spec computers. Sometimes I find players fall through the map for a while so I created a script that allows the players to be teleported back to the ground OR back to a predefined location, per config.

UPDATE:

  • I have added options to check if the player is swimming, falling, and/or inside a building as per request of @iKova! Thank you for the wonderful suggestion!

:beginner: Requirements

  • None, it’s standalone!

:beginner: Features:

  • Configuration file

:beginner: Configuration File:

  • displayText: The message which will be displayed to users
  • key: Key which activates the teleport. Control key numbers can be found here.
  • preset: Whether or not to teleport the player to the ground or to a predefined location
  • coords: The X,Y,Z of the predefined location to teleport the player to if * *preset is true
  • z_check: The Z coordinate to display the prompt and allow the player to teleport
  • freeze: Whether or not to freeze the player after the teleport
  • freeze_time: The amount of time to freeze the player for -in seconds- if *freeze* is set to true
  • check_swimming : Ignore players that are swimming
  • check_falling : Ignore players that are not falling
  • check_inside : Ignore players that are inside buildings - experimental -

:beginner: Preview:

:beginner: Get It Here:!

  • Available for FREE on my Github!

Don’t hesitate to report any issues, offer any constructive criticism, or leave a suggestion!

Check out my other work: [Bait-Car ] | [Play-Time ] | [X-Priorities]

15 Likes

Why not just upload it in Github? Since it’s free, there shouldn’t be any need to add it to tebex.

What if he just likes it.

1 Like

Cause the code is accessible and everyone is able to make PR’s?

2 Likes

Hi, Plz change the topic tag to paid. because in your tabex you put how much I decide to pay so that is paid script

1 Like

@Mohamadchapo read

  • If you are having difficulty checking out for 0$, put 0.0 as the price!
1 Like

its not for free i must pay more than 0USD to get it

Free resources should be uploaded to the forums directly or github

It is free, please be more attentive to what is written!
It is also now available via Github instead of Tebex

It’s a really cool script idea, BUT, imagine you are under water (Diving, Submarine, wtv)…
Wouldn’t it be nice if you tried to implement this native? IS_PED_SWIMMING_UNDER_WATER - Cfx.re Docs

1 Like

maybe add this in client.lua line 9 but i’m not sure

if cords.z < config.z_check and not IsEntityInWater(ped) and not IsPedSwimmingUnderWater(ped) and not IsPedSwimming(ped) then

1 Like

OK I applied the change and it works perfectly

1 Like

Great! I’ll probably upload a pull request on github or you can do it yourself if you want!

1 Like

Haha funny enough I just finished making my changes as well! Already pushed my changes to the Github! Thank you for the kind suggestions and initiative to make the changes! :grin: :bomb:

I added 3 more options to the config file:
check_swimming : Ignore players that are swimming
check_falling : Ignore players that are not falling
check_inside : Ignore players that are inside buildings - experimental -

1 Like

Great!

hi, I’m trying to implement a function that declares that when the player is in an instance the main function of the script is not enabled. I have problems for example with esx_property when a player buys a house he is teleported to an interior under the map for example. any ideas for development?

Try checking if the player is falling as well as underneath the ground. My script above checks for that, per config, if you’re interested in using it!

Another approach could be creating an event in your script which will toggle a boolean variable, which controls whether or not the prompt can be displayed!
Then call this event from the property script upon entry and exit of an interior.

2 Likes

This is a very nice script man! My community loves it :slight_smile:

1 Like

Citizen.CreateThread(function()
Citizen.Wait(1000)

while true do
	-- get the details
	_ped = PlayerPedId()
	-- check if player is dead or not existing
	if cords.z < config.z_check and not IsEntityInWater(ped) and not IsPedSwimmingUnderWater(ped) and not IsPedSwimming(ped) then
	if IsEntityDead(_ped) or not DoesEntityExist(_ped) then
		Citizen.Wait(1000) -- delay it a bit to optimize a little bit
		goto m_next
	end

add the code on line 9 like this??