TheGrimSleeper55555 Posted February 25, 2009 Share Posted February 25, 2009 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 000LaserRifleModeScriptFloat LRModeHealth OnEquipSet LRModeHealth to player.GetWeaponHealthPercplayer.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 More sharing options...
TheGrimSleeper55555 Posted February 26, 2009 Author Share Posted February 26, 2009 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 / 100End Begin OnUnEquip player.additemhealthpercent, 000LaserRifleMode 1 LRModeHealth player.removeitem, 000LaserRifleModeSniper 1 1End Any thoughts? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.