Jump to content

Help me with setTimer


Enri

Recommended Posts

Hi! I'm making my first server on MTA. I ran into a problem. When you spawn , you show up on the island. Not far from the island to spawn a ship and it sails to the island. By the time he gets he needs to make delay in order to go further. Here's how to make a delay on the shipment?

Spoiler

ship = createObject(8493, -5704.3999023438, 3755.1000976563, 15.60000038147,0,0, 261.49658203125)
   moveObject (ship,20000, -5195.1303710938, 3695.7001953125, 15.60000038147)
   --Timer here!!!
   moveObject (ship,30000, -5195.1303710938, 3695.7001953125, 199.60000038147)

 

P.s. Sorry for my English, I'm not English

Edited by Enri
Link to comment
7 hours ago, Enri said:

Hi! I'm making my first server on MTA. I ran into a problem. When you spawn , you show up on the island. Not far from the island to spawn a ship and it sails to the island. By the time he gets he needs to make delay in order to go further. Here's how to make a delay on the shipment?

  Hide contents

ship = createObject(8493, -5704.3999023438, 3755.1000976563, 15.60000038147,0,0, 261.49658203125)
   moveObject (ship,20000, -5195.1303710938, 3695.7001953125, 15.60000038147)
   --Timer here!!!
   moveObject (ship,30000, -5195.1303710938, 3695.7001953125, 199.60000038147)

 

P.s. Sorry for my English, I'm not English

Maybe this?

ship = createObject(8493, -5704.3999023438, 3755.1000976563, 15.60000038147,0,0, 261.49658203125)
moveObject (ship,20000, -5195.1303710938, 3695.7001953125, 15.60000038147)
setTimer(function()
    moveObject (ship,30000, -5195.1303710938, 3695.7001953125, 199.60000038147)
end, time*1000, 1)

in the place "time" enter the time in seconds for how long the timer function should be performed

  • Like 1
Link to comment
1 hour ago, Spc said:

Maybe this?


ship = createObject(8493, -5704.3999023438, 3755.1000976563, 15.60000038147,0,0, 261.49658203125)
moveObject (ship,20000, -5195.1303710938, 3695.7001953125, 15.60000038147)
setTimer(function()
    moveObject (ship,30000, -5195.1303710938, 3695.7001953125, 199.60000038147)
end, time*1000, 1)

in the place "time" enter the time in seconds for how long the timer function should be performed

Thank you, very much))

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...