Jump to content


Photo

Inventory Issues


  • Please log in to reply
No replies to this topic

#1 Sticz

Sticz

    Monkey - In the time of Chimpanzees

  • Member
  • 385 posts

Posted 21 September 2008 - 01:15 AM

I have a boss-monster I want to have a powerful weapon that I cannot loot. However, I want him/her to have an inventory item that I can loot. The sword in question already has a decent script for if the sword falls on the ground, but I need it also to get removed from inventory should I be able to loot it. Here is what I have so far:

ScriptName FirelickSword1
short HasFS

Begin OnActivate
If IsActionRef Player == 1
MessageBox "The weapon crumbles to dust in your hands."
Disable
Else
Activate
EndIf
End

Begin OnAdd Player
If Player.GetItemCount flamesword1 <= 1
If hasFS == 0
Set HasFS to 1
endif
endif
End

Begin GameMode
If Player.GetItemCount flamesword1 >= 1
If HasFS == 1
Player.RemoveItem flamesword1 1
MessageBox "The weapon crumbles to dust in your hands."
Set HasFS to 0
endif
endif
End



This script crashes me to desktop every time. I have tried it without the 'player.removeitem flamesword1 1' and it works perfectly. so the culpret is the remove item, I just dont know what I am doing wrong. Is it becasue the 'player' variable is not more defined?

If anyone has an answer to this, please let me know. Thanks.

Sticz
"For a crazy person, you don't drool much." Complement from Dilbert's Wally.