• True or False Statement
    3 replies, posted
[CODE]if JOKE = true then[/CODE] Hi guys, do you know why this is not working ;D I am sorry though my lua level is not that bad but I think that I made a NOOBIE mistake there :D
One equals sign is the assignment operator. It's used for assigning values. [code] local var = 0; [/code] Two equals signs compares two values, and checks if they are equal. [code] if JOKE == true then ply:Laugh(); end [/code] So basically, add another equals sign and it'll work.
Or you don't even need to compare JOKE to a value. Given that the if statement will only execute if the conditions are true, you could do [lua]if JOKE then ... end[/lua]
[QUOTE=LilSumac;48310425]One equals sign is the assignment operator. It's used for assigning values. [code] local var = 0; [/code] Two equals signs compares two values, and checks if they are equal. [code] if JOKE == true then ply:Laugh(); end [/code] So basically, add another equals sign and it'll work.[/QUOTE] Thank you ;) [editline]28th July 2015[/editline] Wasnt sure at 100%
Sorry, you need to Log In to post a reply to this thread.