When I try saving or running my game it comes up with that error.
Can anybody help me please?
It seems like when I delete
function Dwarf_UseInv()
{
if(player.ActiveInventory==iLeaves){
Jason.Walk(236, 84, eBlock);
Dwarf.Say("&48 Uh.. I don't smoke.");
}
{
if(player.ActiveInventory==Fishstick){
Jason.Walk(236, 84, eBlock);
Dwarf.Say("&49 No thanks. I don't like sushi, It's bad for my stomach.");
}
It works again
Identing might help seeing your syntax errors, you just forgot some braces (said brackets) :
function Dwarf_UseInv()
{
if(player.ActiveInventory==iLeaves)
{
Jason.Walk(236, 84, eBlock);
Dwarf.Say("&48 Uh.. I don't smoke.");
}
else if(player.ActiveInventory==Fishstick)
{
Jason.Walk(236, 84, eBlock);
Dwarf.Say("&49 No thanks. I don't like sushi, It's bad for my stomach.");
}
}
I bet NsMn will have something to say to you ;)
Actually, he had an extra { above the second if statement, and was missing the one at the end (although it's probably in his script and forgot to c&p it over to the forum).
But Sephiroth is right, indenting and formatting your code 'correctly' (cause their's not one way to do it, but there are messy ways) will help make it easier to debug, and to share your code with others.
~Trent
Also, use the match braces feature of the script editor.