Egor_Varaksa 0 Posted March 6 Share Posted March 6 How do I fix this? https://youtu.be/UjKePNof-6A Code (server): parkgate1 = createObject( 968, 2777.123, 905.84, 10.666, 0, 90, 90 ) parkgate2 = createObject( 968, 2777.127, 920.71, 10.62, 0, -90, 90 ) gatebar1 = createObject( 966, 2777.127, 920.71, 9.7, 0, 0, 90 ) gatebar2 = createObject( 966, 2777.123, 905.84, 9.7, 0, 0, -90 ) parkmarker = createMarker(2777, 912.994, 7.75, "cylinder", 13, 255, 0, 0, 0 ) local isMoving = false function gatefunc( hitPlayer ) if isMoving == false then isMoving = true moveObject ( parkgate1, 2000, 2777.123, 905.84, 10.666, 0, -90, 0) moveObject ( parkgate2, 2000, 2777.127, 920.71, 10.62, 0, 90, 0) end end addEventHandler( "onMarkerHit", parkmarker, gatefunc ) function gatefuncclose( ) moveObject ( parkgate1, 2000, 2777.123, 905.84, 10.666, 0, 90, 0) moveObject ( parkgate2, 2000, 2777.127, 920.71, 10.62, 0, -90, 0) setTimer(function() isMoving = false end,2000,1) end addEventHandler( "onMarkerLeave", parkmarker, gatefuncclose ) Link to post
Haxardous 69 Posted Tuesday at 23:11 Share Posted Tuesday at 23:11 (I've moved your topic to a proper section) Link to post
Overkillz 38 Posted Thursday at 10:33 Share Posted Thursday at 10:33 Whats exactly do you want to do ? It is doing what you have coded. Link to post
Egor_Varaksa 0 Posted Thursday at 12:16 Author Share Posted Thursday at 12:16 1 hour ago, Overkillz said: Whats exactly do you want to do ? It is doing what you have coded. How to make sure that it does not fall into the ground? Link to post
Bean666 15 Posted Thursday at 12:51 Share Posted Thursday at 12:51 might be related to that. Link to post
IIYAMA 1,243 Posted Thursday at 13:01 Share Posted Thursday at 13:01 On 06/03/2021 at 17:47, Egor_Varaksa said: function gatefuncclose( ) moveObject ( parkgate1, 2000, 2777.123, 905.84, 10.666, 0, 90, 0) moveObject ( parkgate2, 2000, 2777.127, 920.71, 10.62, 0, -90, 0) setTimer(function() isMoving = false end,2000,1) end addEventHandler( "onMarkerLeave", parkmarker, gatefuncclose ) Try this: function gatefuncclose( ) if isMoving then stopObject(parkgate1) stopObject(parkgate2) moveObject ( parkgate1, 2000, 2777.123, 905.84, 10.666, 0, 90, 0) moveObject ( parkgate2, 2000, 2777.127, 920.71, 10.62, 0, -90, 0) setTimer(function() isMoving = false end,2000,1) end end addEventHandler( "onMarkerLeave", parkmarker, gatefuncclose ) Link to post
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