LiOneLMeSsIShoT Posted July 7, 2013 Share Posted July 7, 2013 What's the wrong with this script? local gate = createObject ( 980, 2287,603.20001220703,12.60000038147,0,0,0) function moveObject (thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2287,603.20001220703,12.60000038147, x, y, z) if (distance<=17) then moveObject (gate, 3000, 2200, 2287,603.20001220703,7) setTimer (moveBack, 4500, 1) else outputChatBox("You are too far away from the gate", thePlayer, 255, 0, 0) end addCommandHandler ("open", moveObject) function moveBack (thePlayer) moveObject (gate, 3000, 2287,603.20001220703,12.60000038147) end when i start it i get ERROR: Warning: Loading script failed: Gate1\gates.lua:24: 'end' expected (to close 'function at line 3) near '(eof)' Please help me guys ....Thanks Link to comment
فاّرس Posted July 7, 2013 Share Posted July 7, 2013 local gate = createObject ( 980, 2287,603.20001220703,12.60000038147,0,0,0) function MoveObject (thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2287,603.20001220703,12.60000038147, x, y, z) if (distance <= 17) then moveObject (gate, 3000, 2200, 2287,603.20001220703,7) setTimer (moveBack, 4500, 1) else outputChatBox("You are too far away from the gate", thePlayer, 255, 0, 0) end end addCommandHandler ("open", MoveObject) function moveBack () moveObject (gate, 3000, 2287,603.20001220703,12.60000038147) end Link to comment
LiOneLMeSsIShoT Posted July 7, 2013 Author Share Posted July 7, 2013 local gate = createObject ( 980, 2287,603.20001220703,12.60000038147,0,0,0) function MoveObject (thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2287,603.20001220703,12.60000038147, x, y, z) if (distance <= 17) then moveObject (gate, 3000, 2200, 2287,603.20001220703,7) setTimer (moveBack, 4500, 1) else outputChatBox("You are too far away from the gate", thePlayer, 255, 0, 0) end end addCommandHandler ("open", MoveObject) function moveBack () moveObject (gate, 3000, 2287,603.20001220703,12.60000038147) end and what the problem was with the script? Link to comment
#DRAGON!FIRE Posted July 7, 2013 Share Posted July 7, 2013 local gate = createObject ( 980, 2287,603.20001220703,12.60000038147,0,0,0) function MoveObject (thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2287,603.20001220703,12.60000038147, x, y, z) if (distance <= 17) then moveObject (gate, 3000, 2200, 2287,603.20001220703,7) setTimer (moveBack, 4500, 1) else outputChatBox("You are too far away from the gate", thePlayer, 255, 0, 0) end end addCommandHandler ("open", MoveObject) function moveBack () moveObject (gate, 3000, 2287,603.20001220703,12.60000038147) end and what the problem was with the script? Problem is : " You Need end at line 17 Link to comment
LiOneLMeSsIShoT Posted July 7, 2013 Author Share Posted July 7, 2013 local gate = createObject ( 980, 2287,603.20001220703,12.60000038147,0,0,0) function MoveObject (thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2287,603.20001220703,12.60000038147, x, y, z) if (distance <= 17) then moveObject (gate, 3000, 2200, 2287,603.20001220703,7) setTimer (moveBack, 4500, 1) else outputChatBox("You are too far away from the gate", thePlayer, 255, 0, 0) end end addCommandHandler ("open", MoveObject) function moveBack () moveObject (gate, 3000, 2287,603.20001220703,12.60000038147) end and what the problem was with the script? lol... now when i just write /open...the gate hide really fast speed! then come back after 4 seconds...wtf? it's not open good..just hide and back..and type /open the gate change position.... Link to comment
#DRAGON!FIRE Posted July 7, 2013 Share Posted July 7, 2013 local gate = createObject ( 980, 2287,603.20001220703,12.60000038147,0,0,0) function MoveObject (thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(2287,603.20001220703,12.60000038147, x, y, z) if (distance <= 17) then moveObject (gate, 3000, 2200, 2287,603.20001220703,7) setTimer (moveBack, 4500, 1) else outputChatBox("You are too far away from the gate", thePlayer, 255, 0, 0) end end addCommandHandler ("open", MoveObject) function moveBack () moveObject (gate, 3000, 2287,603.20001220703,12.60000038147) end and what the problem was with the script? lol... now when i just write /open...the gate hide really fast speed! then come back after 4 seconds...wtf? it's not open good..just hide and back..and type /open the gate change position.... # I did not understand what the problem is exactly, but then increase Timer Link to comment
فاّرس Posted July 7, 2013 Share Posted July 7, 2013 and what the problem was with the script? The problem in your code , in the line 17 you need 'end' and can you tell me what do you want to do ? Link to comment
LiOneLMeSsIShoT Posted July 7, 2013 Author Share Posted July 7, 2013 and what the problem was with the script? The problem in your code , in the line 17 you need 'end' and can you tell me what do you want to do ? when i write /open..the gate just hides and after the timer back the gate just be shown in another position..it's the problem..may you test the gate and see? if you can Link to comment
فاّرس Posted July 7, 2013 Share Posted July 7, 2013 Sorry i'm cannot test it , but tell me when you write /open what happens ? Link to comment
LiOneLMeSsIShoT Posted July 8, 2013 Author Share Posted July 8, 2013 Sorry i'm cannot test it , but tell me when you write /open what happens ? ' I will give you the photos 1--------- 2-------- 3--------- Link to comment
LiOneLMeSsIShoT Posted July 8, 2013 Author Share Posted July 8, 2013 Sorry i'm cannot test it , but tell me when you write /open what happens ? ' I will give you the photos 1--------- 2-------- 3--------- as you see the gate just hide and back after 4500 no more... Link to comment
فاّرس Posted July 8, 2013 Share Posted July 8, 2013 and what the error ? the error is timer short ? or what ? Link to comment
LiOneLMeSsIShoT Posted July 8, 2013 Author Share Posted July 8, 2013 and what the error ?the error is timer short ? or what ? The problem is..i want the gate...Down...And Up...and the gate in this script Hide and Back when the timer End...and it's not a short time..idk what the problem with..I think position of the gate? Link to comment
فاّرس Posted July 8, 2013 Share Posted July 8, 2013 if you want the gate ' Down' and 'Up' why you make timer with another position ? move the gate 'Down' and make timer for 'Up' Link to comment
LiOneLMeSsIShoT Posted July 8, 2013 Author Share Posted July 8, 2013 if you want the gate ' Down' and 'Up' why you make timer with another position ?move the gate 'Down' and make timer for 'Up' Okay Thanks i will try and tell you Link to comment
LiOneLMeSsIShoT Posted July 8, 2013 Author Share Posted July 8, 2013 if you want the gate ' Down' and 'Up' why you make timer with another position ?move the gate 'Down' and make timer for 'Up' Okay Thanks i will try and tell you Thanks A lot...The Problem was from the Position of Function moveObject... Thanks for helping Link to comment
فاّرس Posted July 8, 2013 Share Posted July 8, 2013 if you want the gate ' Down' and 'Up' why you make timer with another position ?move the gate 'Down' and make timer for 'Up' Okay Thanks i will try and tell you Thanks A lot...The Problem was from the Position of Function moveObject... Thanks for helping You're welcome. Link to comment
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