Jump to content

Weapon health variable?


TheGrimSleeper55555

Recommended Posts

I'm working on a fire-mode mod, but I have some trouble scripting in a way to maintain the weapons condition.

Here is part of the script.

 

scn 000LaserRifleModeScript

Float LRModeHealth

 

OnEquip

Set LRModeHealth to player.GetWeaponHealthPerc

player.AddItemHealthPercent, 000LaserRifleModeSniper 1 LRModeHealth

 

When I try it in-game, the spawned weapon always has 100%, and it doesn't even seem to take any damage when fired.

More info on the mod:

http://thenexusforums.com/index.php?showto...mp;#entry859516

Link to comment
Share on other sites

The reason the above line failed was because GetWeaponHealthPerc returns a % value like 50.00 or 99.00, were as AddItemHealthPercent needs a fraction like 0.50 or 0.99.

With that solved, a new problem has arisen:

The weapons health is frozen. When it is fired, it takes no damage. The script on the weapon is:

 

scn 000LaserRifleModeUnequipSniperScript

 

Float LRModeHealth

 

Begin GameMode

Set LRModeHealth to player.GetWeaponHealthPerc / 100

End

 

Begin OnUnEquip

player.additemhealthpercent, 000LaserRifleMode 1 LRModeHealth

player.removeitem, 000LaserRifleModeSniper 1 1

End

 

Any thoughts?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...