• Help with code.
    5 replies, posted
[CODE]function myFunc() color(0,0,0) if color == (0,0,0), then chat.AddText("Your color is "..WhatsMyColor.."!\n") end SayMyColor("Not sure maaan") function myFunc1() if SayMyColor == ("Not sure maaan") then PlaySound("revive") else PlaySound("chaching") if PlaySound == ("chaching") then WhatsMyColor(0,25,00) end[/CODE] Everytime I try to run it,console says [lua\ass.lua:3] ')' expected near ',' .Any ideas how to solve this? Thanks.
[lua] if color == (0,0,0), [/lua] remove the ' , '
I did that,but problem remains :suicide: Any other ideas?
You should read through the Lua tutorial series on the GMod wiki. You have variables and functions a bit messed up.
remove the comma near parentheses at the 3rd line
You aren't defining variables correctly. SayMyColor("Not sure maaan") is wrong WhatsMyColor(0,25,00) is wrong SayMyColor == ("Not sure maaan") is wrong PlaySound == ("chaching") is wrong color == (0,0,0), is wrong They should be local SayMyColor = "Not sure maaan" local WhatsMyColor = Color(0,25,00) SayMyColor == "Not sure maaan" PlaySound = "revive" PlaySound == "chaching" color == Color(0,0,0)
Sorry, you need to Log In to post a reply to this thread.