gazzxr Posted November 17, 2010 Posted November 17, 2010 Hey , whats up , i'm new , and i'm learning Lua scripting , my 1st mission was to make object go up and down . so i wrote this : --DDC OMG generated script: function omgInit() omg6537 = createObject(8546,-294.5478515625,1006.5712890625,144.27891540527,0,0,0) omgMoveomg6537(1) end function omgMoveomg6537(point) if point == 1 then moveObject(omg6537,250,-294.5478515625,1006.5712890625,150.9789276133,0,0,0) setTimer(omgMoveomg6537,250 + 1500, 1, 2) elseif point == 2 then moveObject(omg6537,250,-294.5478515625,1006,5712890625,144.27891540527,0,0,0) setTimer(omgMoveomg6537,250 + 1500, 1, 2) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), omgInit) and all was OK , then when i started my resource ( script ) object just goes up, then after 1500ms it returns to its normal position . How do i make this loop? up&down?
greacius Posted November 17, 2010 Posted November 17, 2010 well when it is at point 2... it should go back to point 1 right? So in the function omgMoveomg6537() replace the timer after the point == 2 with: setTimer(omgMoveomg6537,1500,1,1) It should work then. http://AllesOverServers.nl http://www.zakelijkthuis.nl/promoot.php?x=4179
gazzxr Posted November 17, 2010 Author Posted November 17, 2010 well when it is at point 2... it should go back to point 1 right?So in the function omgMoveomg6537() replace the timer after the point == 2 with: setTimer(omgMoveomg6537,1500,1,1) It should work then. Damn , it does not work. i replaced it , now it looks like --DDC OMG generated script: function omgInit() omg6537 = createObject(8546,-294.5478515625,1006.5712890625,144.27891540527,0,0,0) omgMoveomg6537(1) end function omgMoveomg6537(point) if point == 1 then moveObject(omg6537,250,-294.5478515625,1006.5712890625,150.9789276133,0,0,0) setTimer(omgMoveomg6537,250 + 1500, 1, 2) elseif point == 2 then moveObject(omg6537,250,-294.5478515625,1006,5712890625,144.27891540527,0,0,0) setTimer(omgMoveomg6537,1500,1,1) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), omgInit) ANd yes , it should go back to same point as it started from , at the same speed.
greacius Posted November 17, 2010 Posted November 17, 2010 Does it give any error? http://AllesOverServers.nl http://www.zakelijkthuis.nl/promoot.php?x=4179
Aibo Posted November 17, 2010 Posted November 17, 2010 you didn't "wrote" this script, it was generated by my resource. and unless you've edited it (and it looks like you did), it should work fine. line 11(12): moveObject(omg6537,250,-294.5478515625,[color=#FF0000]1006,5712890625[/color],144.27891540527,0,0,0) 1006,5712890625 > 1006.5712890625 fix this. ?
gazzxr Posted November 17, 2010 Author Posted November 17, 2010 you didn't "wrote" this script, it was generated by my resource. and unless you've edited it (and it looks like you did), it should work fine. line 11(12): moveObject(omg6537,250,-294.5478515625,[color=#FF0000]1006,5712890625[/color],144.27891540527,0,0,0) 1006,5712890625 > 1006.5712890625 fix this. Silly me , stupid mistakes >.> , thanks man , it realy helpd , but i'm still not getting it to go up&down all the time... looping. AND YES , its Copied from you're program (OMG) so i "Wrote" it down... Useful dough...
dzek (varez) Posted November 17, 2010 Posted November 17, 2010 Your posts suggested that's your work, but whateveer.. 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)!
gazzxr Posted November 17, 2010 Author Posted November 17, 2010 Your posts suggested that's your work, but whateveer.. You got it wrong .... now can someone help me?
dzek (varez) Posted November 17, 2010 Posted November 17, 2010 "OMG" generates movement back and forth. If you broken it with your edits - just make it perfect in generator, don't edit it if you don't know what are you doing. 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)!
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