megaman54 Posted June 17, 2011 Share Posted June 17, 2011 Hello! I made a script where you can remove a vehicle with silenced pistol but the on/off toggle is not working very well. Here is the problem: when i start the script, it says in debugscript 3 that "WARNING: loading script failed: vehicleremover\server.lua:6 '=' expected near '==' " and here is the code wich causes the error: function toggleRemover() if(removerEnabled == false)then removerEnabled == true else removerEnabled == false end end addCommandHandler("vremover", toggleRemover) in this case its line 3. Link to comment
Aibo Posted June 17, 2011 Share Posted June 17, 2011 its =, not ==. == is for comparison. and function toggleRemover() removerEnabled = not removerEnabled end addCommandHandler("vremover", toggleRemover) Link to comment
megaman54 Posted June 17, 2011 Author Share Posted June 17, 2011 Oh! Thanks and i'm not so good with this "if" stuff yet... 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