Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Gun with ammo variable

10 years ago

How do I make a gun item only be able to be used when an ammo variable is greater than 1, while at the same time whenever the gun is used ammo goes down 1?

Gun with ammo variable

10 years ago

You would need scripting, so in the item script.

If %AMMO < 1

Then %PAGEID := (what ever page id the "out of ammo" page is)

Gun with ammo variable

10 years ago

^ What Beta Said -

Need Ammo Variable : %AMMO
Need Damage Variable : %DMG
Need Hit Point Variable for each Goon : %GOON1HP
Need Gun Item : Gun Item with Damage/Ammo Script
Need Gunfire Results Page : Say 100
Need Dead Goon Page : Say 200
Need Out of Ammo Page : Say 500

---

Gun Item Script:

IF %AMMO < 1 THEN $DEST := @P500
IF %AMMO > 0 THEN
BEGIN
%AMMO := %AMMO - 1
%DMG := 1D6+4
%GOON1HP := %GOON1HP - %DMG
IF %GOON1HP > 0 THEN $DEST := @P100
IF %GOON1HP < 1 THEN $DEST := @P200
END

Gun with ammo variable

10 years ago

Put this in the item script page:

%AMMO := %AMMO - 1

IF %AMMO < 1 THEN

BEGIN

$DEST := @NONE

END

Gun with ammo variable

10 years ago

Thanks everyone :)