Thehookerkiller01 Posted April 16, 2009 Share Posted April 16, 2009 (edited) Just had made 1 script (yes, at my own ) but there is a error in it: My script: function createstartvehicles ( playerSource, source, commandName, car, x, y, z ) -- the function allows specification of your car, and the position fadeCamera ( source, false, 1.0, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCamera, 500, 1, source, true, 0.5 ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal normal local racevehicle = createVehicle ( 420, x, y, z ) -- create a vehicle at the position specified by the startrace command warpPlayerIntoVehicle ( playerSource, racevehicle ) -- warp them straight into the vehicle Error: [21:27:54] SCRIPT ERROR: .../MTA/mods/deathmatch/resources/race/script.lua:40: '=' expected near 'local' [21:27:54] INFO: Loading script failed: .../MTA/mods/deathmatch/resources/race/script.lua:40: '=' expected near 'local' What's the problem? Edited April 16, 2009 by Guest Link to comment
Gamesnert Posted April 16, 2009 Share Posted April 16, 2009 Maybe it'd be useful to also post the line before "local blah=blah". Link to comment
Thehookerkiller01 Posted April 16, 2009 Author Share Posted April 16, 2009 Maybe it'd be useful to also post the line before "local blah=blah". Done with an edit. Read above Link to comment
Gamesnert Posted April 16, 2009 Share Posted April 16, 2009 ... normal ... What's this doing there... Link to comment
Thehookerkiller01 Posted April 16, 2009 Author Share Posted April 16, 2009 ... normal ... What's this doing there... http://development.mtasa.com/index.php?title=FadeCamera function addRednessOnDamage ( ) fadeCamera ( source, false, 1.0, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCamera, 500, 1, source, true, 0.5 ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal end addEventHandler ( "onPlayerDamage", getRootElement(), addRednessOnDamage ) Link to comment
Slothman Posted April 16, 2009 Share Posted April 16, 2009 what your reading there is a continuation of the comment above it. your "normal" line is its own line, delete it and problem solved Link to comment
Thehookerkiller01 Posted April 16, 2009 Author Share Posted April 16, 2009 what your reading there is a continuation of the comment above it. your "normal" line is its own line, delete it and problem solved ok, but also the local problem? Link to comment
Willy Posted April 17, 2009 Share Posted April 17, 2009 the local is on the following line, and it sees that as the error instead of the line above. If you learn to interpret the errors (and test when someone tells you the answer) it would save a lot of time. Link to comment
Thehookerkiller01 Posted April 17, 2009 Author Share Posted April 17, 2009 the local is on the following line, and it sees that as the error instead of the line above.If you learn to interpret the errors (and test when someone tells you the answer) it would save a lot of time. Yes, but '=' expected near 'local' Local have to be an = ? Link to comment
Gamesnert Posted April 17, 2009 Share Posted April 17, 2009 Oh god you don't bother to try, or even to read... Now do you... What do we need to do to make you try to get your brains working... Do we need to put it under high voltage? Link to comment
robhol Posted April 17, 2009 Share Posted April 17, 2009 Oh god you don't bother to try, or even to read... Now do you...What do we need to do to make you try to get your brains working... Do we need to put it under high voltage? At least one megavolt, please. Link to comment
Slothman Posted April 17, 2009 Share Posted April 17, 2009 just remove the line we told you about, and itll solve the problem your seeing. Link to comment
Thehookerkiller01 Posted April 18, 2009 Author Share Posted April 18, 2009 No, just another error. Script: function createstartvehicles ( playerSource, source, commandName, car, x, y, z ) -- the function allows specification of your car, and the position fadeCamera ( source, false, 1.0, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second setTimer ( fadeCamera, 500, 1, source, true, 0.5 ) local racevehicle == createVehicle ( 420, x, y, z ) -- create a vehicle at the position specified by the startrace command warpPlayerIntoVehicle ( playerSource, racevehicle ) -- warp them straight into the vehicle setElementPosition ( source, 2002.5007324219, -1445.4700927734, 13.6 ) removePlayerFromVehicle ( source ) end Then the error: [09:12:02] SCRIPT ERROR: .../MTA/mods/deathmatch/resources/race/script.lua:39: unexpected symbol near '==' [09:12:02] INFO: Loading script failed: .../MTA/mods/deathmatch/resources/race/script.lua:39: unexpected symbol near '==' Link to comment
Lordy Posted April 18, 2009 Share Posted April 18, 2009 ffs, you are making my knee hurt.. Have you even learned ANY of lua's syntax by now? Link to comment
Gamesnert Posted April 18, 2009 Share Posted April 18, 2009 Lord's knee, and my eyes... Seriously, why the hell did you change this... local racevehicle = createVehicle ( 420, x, y, z ) ...Into this... local racevehicle == createVehicle ( 420, x, y, z ) First one should have worked perfectly and then you change it in something that doesn't make any sense at all... "==" is only for checking if something is equal to a value, NOT for defining a value... That's what "=" is for... Link to comment
Thehookerkiller01 Posted April 18, 2009 Author Share Posted April 18, 2009 Lord's knee, and my eyes...Seriously, why the hell did you change this... local racevehicle = createVehicle ( 420, x, y, z ) ...Into this... local racevehicle == createVehicle ( 420, x, y, z ) First one should have worked perfectly and then you change it in something that doesn't make any sense at all... "==" is only for checking if something is equal to a value, NOT for defining a value... That's what "=" is for... Ah thx, i just had give a try. Sorry Link to comment
robhol Posted April 18, 2009 Share Posted April 18, 2009 Lord's knee, and my eyes...Seriously, why the hell did you change this... local racevehicle = createVehicle ( 420, x, y, z ) ...Into this... local racevehicle == createVehicle ( 420, x, y, z ) First one should have worked perfectly and then you change it in something that doesn't make any sense at all... "==" is only for checking if something is equal to a value, NOT for defining a value... That's what "=" is for... Ah thx, i just had give a try. Sorry You "had to give a try", and when it gave you an error you didn't think of undoing it? Duh. I don't know whether to laugh or facepalm or cry, or any combination. Once again; read the basics. (I suggest everybody not to help this guy until he does.) Also, thehookerkiller, stop answering questions. You don't know enough, and just end up giving people wrong information. Link to comment
Thehookerkiller01 Posted April 21, 2009 Author Share Posted April 21, 2009 Lord's knee, and my eyes...Seriously, why the hell did you change this... local racevehicle = createVehicle ( 420, x, y, z ) ...Into this... local racevehicle == createVehicle ( 420, x, y, z ) First one should have worked perfectly and then you change it in something that doesn't make any sense at all... "==" is only for checking if something is equal to a value, NOT for defining a value... That's what "=" is for... Ok now changed it, but now there is just an error with everything in the script. Link to comment
Lordy Posted April 21, 2009 Share Posted April 21, 2009 Well in that case we obviously know the solution.. Link to comment
Thehookerkiller01 Posted April 21, 2009 Author Share Posted April 21, 2009 Well in that case we obviously know the solution.. And what is the solution? Link to comment
[DKR]silverfang Posted April 21, 2009 Share Posted April 21, 2009 Well in that case we obviously know the solution.. And what is the solution? Ah that's easy... LEARN!! Until you learn the syntax for lua then you will not be able to code properly... http://lua-users.org/wiki/LuaTutorial if you're still having trouble then: http://tinyurl.com/deny6a Link to comment
Lordy Posted April 22, 2009 Share Posted April 22, 2009 Plus one guide for asking questions.. I didn't really think you'd believe when I said we obviously know the answer if you had only said that you have problems... But yeh. this is the guide - http://www.catb.org/~esr/faqs/smart-que ... tml#before 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