Posted 11 March 2018 - 07:02 PM
Hello, I been working on this game "Cookie Clicker" but I cant seem to get it to work, its something to do with this part I think
I'm trying to make it so if cookies are above the ClickerCost it will show green, it dose that at start like this,
https://i.imgur.com/rvpWeZE.png
as you can see its red, but when I click on the cookie I get this error,
Here are the two files….
https://pastebin.com/zRqXqmVu – The assests loader if your only looking at the code you dont need this
https://pastebin.com/JxZFb1LJ – The main file where the errors happen
if you want to start this up on your own computer, startup the CookieClicker.exe then when its done finishing assests terminate it because the error box I made covers the red error text and also the assests need to load in first
ik this sounds complicated but I need this fixing, any questions about the code please ask
function drawShop()
paintutils.drawFilledBox(30, 3, 50, 6, colors.orange)
scp(32,4)
stc(1)
w([[ Clicker ]])
scp(32,5)
if Cookies >= ClickerCost then -- This part
stc( colors.green )
term.write(ClickerCost.." Cookies")
else
stc( colors.red )
scp(32,5)
term.write(ClickerCost.." Cookies")-
end
end
I'm trying to make it so if cookies are above the ClickerCost it will show green, it dose that at start like this,
https://i.imgur.com/rvpWeZE.png
as you can see its red, but when I click on the cookie I get this error,
main.lua:77: attempt to compare number with string expected, got number
Here are the two files….
https://pastebin.com/zRqXqmVu – The assests loader if your only looking at the code you dont need this
https://pastebin.com/JxZFb1LJ – The main file where the errors happen
if you want to start this up on your own computer, startup the CookieClicker.exe then when its done finishing assests terminate it because the error box I made covers the red error text and also the assests need to load in first
ik this sounds complicated but I need this fixing, any questions about the code please ask