MamadHastam Posted February 1, 2023 Posted February 1, 2023 (edited) 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 February 1, 2023 by MamadHastam
alex17" Posted February 1, 2023 Posted February 1, 2023 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
MamadHastam Posted February 2, 2023 Author Posted February 2, 2023 oh right my bad... tnx i also had an anther question ! i want to teleport player to a pos and give him a car and after 2 minute destroy element car and teleport him to another position but i dont know how can you help me with that?
JeViCo Posted February 2, 2023 Posted February 2, 2023 setTimer syntax: setTimer(callback_func, timeout_in_ms, times_to_execute, ...callback_args) You can do both things setTimer(setElementPosition, 30*1000, 1, element, x, y, z) -- single action -- equals to setTimer(function() setElementPosition(element, x, y, z) -- other actions here end, 30*1000, 1) These functions may help you: createVehicle, warpPedIntoVehicle, destroyElement
alex17" Posted February 3, 2023 Posted February 3, 2023 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)
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