Jump to content

(HELP)settimer


MamadHastam

Recommended Posts

hello please help me with it i used many ways to make it but it didn't work
i want SetElementPostion player on somewhere and after 20 sec send him to another position
 

function tel1()
	if isCursorOverRectangle() then
	setElementPosition ( )
	settimer (function(),
	setElementPosition ( )
    end, 5000, 1 )
end

 

Edited by MamadHastam
Link to comment
function tel1()
	if isCursorOverRectangle() then
	   setElementPosition ( )
	   setTimer (
          function()
             setElementPosition ( )
          end 
       end, 20000, 1 )
   end
end

it's setTimer not settimer 

the function inside the timer must end with an end and you also had a comma in the function

Finally you needed to close the first if with an end

Link to comment
Hace 12 horas, MamadHastam dijo:

oh cierto, mi error... tnx
¡también tenía otra pregunta!
Quiero teletransportar al jugador a una posición y darle un automóvil y después de 2 minutos destruir el elemento del automóvil y
teletransportarlo a otra posición, pero no sé cómo pueden ayudarme con eso.

function giveVehicle(player)
   local v = createVehicle(....)
   warpPedIntoVehicle(player, v)
   setElementPosition(v, ...)
   setTimer(function(player)
      destroyElement(v)
      if isElement(player) then 
         setElementPosition(player, ...)
      end 
   end, 120000, 1, player) 
end 

function test(player)
   giveVehicle(player)
end 
addCommandHandler("testvehicle", test)

 

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