BenceDev Posted February 11, 2023 Share Posted February 11, 2023 Hi everyone! I make a script that know player altitude when the altitude is like example 1000 feet then play a sound for player. So i know how to play sound to player, but i cant know how to get airplane altitude. Thanks for the helps! Link to comment
Kidzonio Posted February 11, 2023 Share Posted February 11, 2023 Heyo Bro, you will need to do calcs. I think the functions are these getGroundPosition and getElementPosition now, the functions i think are now, the functions i think ar 1 Link to comment
BenceDev Posted February 11, 2023 Author Share Posted February 11, 2023 Thanks bro, i try it later! Have a great day! @Kidzonio 1 Link to comment
FLUSHBICEPS Posted February 11, 2023 Share Posted February 11, 2023 local sound = playSound("path/to/sound.mp3") local targetAltitude = 1000 addEventHandler("onClientRender", root, function() local x, y, z = getElementPosition(getLocalPlayer()) local groundY = getGroundPosition(x, z) local altitude = y - groundY if altitude >= targetAltitude then playSound(sound) end end ) 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now