Please help me.
Heres what i wanted there are 3 different kinds of axes to cut a tree.
1 axe is iron when i use the item on the tree it gives me 1 wood log.
when i use another axe a granite axe on the tree, it gives 2 wood logs.
when i use a starfite axe on the tree it gives 3 logs.
heres the code that i use and it deoesnt work (dont make fun of me its stupid):
function hHotspot1_UseInv()
{
if (player.ActiveInventory == iaxeiron) {
player.AddInventory(ilog);
Display("You have collected a log.");
if (player.ActiveInventory == iaxegranite)
player.AddInventory(ilog);
player.AddInventory(ilog);
Display("You have collected logs.");
if (player.ActiveInventory == iaxestar)
player.AddInventory(ilog);
player.AddInventory(ilog);
player.addinventory(ilog);
Display("You have collected logs.");
}
else Display("You need an axe to cut this tree.");
}
insted of doing that when i use the iron axe it gives me 2 logs!!!! i wanted 1!
when i use granite and stafite it gives the you need an axe to cut this tree display thingy
can u give the code?
Mind the placement of the brackets:
function hHotspot1_UseInv() {
if (player.ActiveInventory == iaxeiron) {
player.AddInventory(ilog);
Display("You have collected a log.");
} // was missing
if (player.ActiveInventory == iaxegranite) { // was missing
player.AddInventory(ilog);
player.AddInventory(ilog);
Display("You have collected logs.");
} // was missing
if (player.ActiveInventory == iaxestar) { // was missing
player.AddInventory(ilog);
player.AddInventory(ilog);
player.addinventory(ilog);
Display("You have collected logs.");
}
else Display("You need an axe to cut this tree.");
}
Should be more 'else' added, otherwise the 'no axe' message will be displayed in the first two cases.
function hHotspot1_UseInv()
{
if (player.ActiveInventory == iaxeiron) {
player.AddInventory(ilog);
Display("You have collected a log.");
} else if (player.ActiveInventory == iaxegranite) {
player.AddInventory(ilog);
player.AddInventory(ilog);
Display("You have collected logs.");
} else if (player.ActiveInventory == iaxestar) {
player.AddInventory(ilog);
player.AddInventory(ilog);
player.addinventory(ilog);
Display("You have collected logs.");
} else Display("You need an axe to cut this tree.");
}
thanks u 2 guys but um lol u acidently forgot to put capitals in the 13th script...
but hey it works now!!
As did you.... but at least the problems solved.
~Trent