Jump to content

Help AttachElement and MoveObject


Namorek

Recommended Posts

Posted

learn lua? begging us for doing whole script for you wont help i think..

there was a lot of scripts moving objects in two ways here, look in this forum for them..

and just add attach object, and thats all

this could help you (click on the function name to get more help)

attachElements
moveObject

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
learn lua? begging us for doing whole script for you wont help i think..

there was a lot of scripts moving objects in two ways here, look in this forum for them..

and just add attach object, and thats all

this could help you (click on the function name to get more help)

attachElements
moveObject

Yes Lua bur please give me Code look you my idea http://img339.imageshack.us/img339/604/beztytuuxej.jpg you know??

Posted

I think that isn't really gonna help him. How's he supposed to understand a wiki page when he apparently didn't even get the basic gist of varez' post?

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted

1. sit down

2. breath deeply

3. start thinking

4. take some break ;)

5. start thinking again

6. open https://wiki.multitheftauto.com/ and use your FORCE! ;)

i dont knw the other ppl point of view, but personally i think it's waste of time to fullfilling requests of lazy ppl

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

lol, varez will be mad, but ill try

local x,y,z,object= --offsets and object here
function moveUp()
setTimer(function()
     z=z+0.2
setElementAttachedOffsets(object,x,y,z)
end,200,40)
setTimer(moveDown,8000,1)
end
 
function moveDown()
setTimer(function()
     z=z-0.2
setElementAttachedOffsets(object,x,y,z)
end,200,40)
setTimer(moveUp,8000,1)
end

just call one of the functions to start the move

Posted
lol, varez will be mad, but ill try
local x,y,z,object= --offsets and object here
function moveUp()
setTimer(function()
     z=z+0.2
setElementAttachedOffsets(object,x,y,z)
end,200,40)
setTimer(moveDown,8000,1)
end
 
function moveDown()
setTimer(function()
     z=z-0.2
setElementAttachedOffsets(object,x,y,z)
end,200,40)
setTimer(moveUp,8000,1)
end

just call one of the functions to start the move

Nice Job but no has Attach Vehicle :(

Posted

What? I do not know Karlis! Who is he? End of good about it because you do not work and you do not understand about tomorrow removed topic. :cry:

Posted

car = createVehicle(400,0,0,5)
marker = createMarker(0,0,0,"ring")
offset = 2
max_offset, min_offset = 10, 2
bool = true
obnizacz = 0.05
 
attachElements(marker, car, 0, 0, offset)
 
addEventHandler("onClientRender", getRootElement(), 
   function ()
       if bool then
           if offset >= max_offset then
               bool = false
           else
               offset = offset + obnizacz
           end
       else
           if offset <= min_offset then
               bool = true
           else
               offset = offset - obnizacz
           end
       end
 
       setElementAttachedOffsets(marker, 0, 0, offset)
   end)

+

local x,y,z,object= --offsets and object here
function moveUp()
  setTimer(function()
     z=z+0.2
     setElementAttachedOffsets(object,x,y,z)
  end,200,40)
  setTimer(moveDown,8000,1)
end
 
function moveDown()
setTimer(function()
     z=z-0.2
     setElementAttachedOffsets(object,x,y,z)
  end,200,40)
  setTimer(moveUp,8000,1)
end

=

My Code is good??

But How Attach+Move=..... Help!!

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