Jump to content

Need help with a script


eleglas

Recommended Posts

Hi, I'm trying to make a multiple weapon mod (yes I do alot of these), I have the following the script so far which is on an armor, but when I use it and choose my gun, it doesn't appear untill I choose another one, and so on and so forth.

 

Can someone help me fix this?

 

Heres my script:

 

SCN DurhamRifleChangeScript

Short Button

Begin OnEquip

Set Button to GetButtonPressed

showmessage DurhamRifleMessage

If Button == 0
	Player.additem WeapDurhamRifleNorm 1 1
	Player.Equipitem WeapDurhamRifleNorm
ElseIf Button == 1
	Player.additem WeapDurhamRifleSilence 1 1
	Player.Equipitem WeapDurhamRifleSilence
ElseIf Button == 2
	Player.additem WeapDurhamRifleScope 1 1
	Player.Equipitem WeapDurhamRifleScope
ElseIf Button == 3
	Player.additem WeapDurhamRifleSilenceScope 1 1
	Player.Equipitem WeapDurhamRifleSilenceScope
Endif

Player.Unequipitem RifleSetting

END

Link to comment
Share on other sites

SCN DurhamRifleChangeScript

Short Button

Begin OnEquip

Set Button to GetButtonPressed

showmessage DurhamRifleMessage

   If Button == 0
       Player.additem WeapDurhamRifleNorm 1 1
       Player.Equipitem WeapDurhamRifleNorm
   ElseIf Button == 1
       Player.additem WeapDurhamRifleSilence 1 1
       Player.Equipitem WeapDurhamRifleSilence
   ElseIf Button == 2
       Player.additem WeapDurhamRifleScope 1 1
       Player.Equipitem WeapDurhamRifleScope
   ElseIf Button == 3
       Player.additem WeapDurhamRifleSilenceScope 1 1
       Player.Equipitem WeapDurhamRifleSilenceScope
   Endif

Player.Unequipitem RifleSetting

END

 

Change it to:

 

SCN DurhamRifleChangeScript

short Button

begin OnEquip

ShowMessage DurhamRifleMessage
end

begin GameMode

Set Button to GetButtonPressed

If ( Button == 0 )
	Player.Additem WeapDurhamRifleNorm 1 1
	Player.Equipitem WeapDurhamRifleNorm
Elseif ( Button == 1 )
	Player.additem WeapDurhamRifleSilence 1 1
	Player.Equipitem WeapDurhamRifleSilence
Elseif ( Button == 2 )
	Player.additem WeapDurhamRifleScope 1 1
	Player.Equipitem WeapDurhamRifleScope
Elseif ( Button == 3 )
	Player.additem WeapDurhamRifleSilenceScope 1 1
	Player.Equipitem WeapDurhamRifleSilenceScope
endif
Player.Unequipitem RifleSetting
end

 

Diffrent is that you have to use GameMode for the buttons^^

Link to comment
Share on other sites

  • Recently Browsing   0 members

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