I don’t know if this makes sense but i followed a similar formula to what i have done previously
function sellWeapon() {
if (inventory.length > 1) {
gold += 15;
goldText.innerText = gold;
}
let currentWeapon ()
{}
}
I don’t know if this makes sense but i followed a similar formula to what i have done previously
function sellWeapon() {
if (inventory.length > 1) {
gold += 15;
goldText.innerText = gold;
}
let currentWeapon ()
{}
}
currentWeapon
isn’t a function, so it shouldn’t have parentheses and curly braces. It’s just a variable name.
Also, it needs to be inside the if
block.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.