Jump to content
⚠ Known Issue: Media on User Profiles ×

scripting troubles


Pope74220

Recommended Posts

if Player.GetcurrentAmmo == Bayonet
	showmessage bayonetmessage
if GetButtonPressed == 0
	Player.Equipitem WeapNVServiceRifleBayonet2
		elseif GetButtonPressed == 1
	Player.Equipitem Ammo556mm
	endif
end

new vegas geck refuses to tell me what's wrong with the script

trying to do:

if you have bayonet ammo equipped, then...

show a message with yes and no

if yes, equip the melee version of the bayonet

otherwise, switch to standard 5.56mm ammo

end

Link to comment
Share on other sites

if Player.GetcurrentAmmo == Bayonet
	showmessage bayonetmessage
	if GetButtonPressed == 0
		Player.Equipitem WeapNVServiceRifleBayonet2
	elseif GetButtonPressed == 1
		Player.Equipitem Ammo556mm
	endif
end

The way you have it, the check for button pressed is being tied to the ammo check. Adjusted the spacing so you kinda see what's going on.

You also usually have to wait a tick between showmessage and the response for it to be used right unless they happen in different blocktypes.

Like:

Begin OnActivate
if Player.GetcurrentAmmo == Bayonet
	showmessage bayonetmessage
endif
end

begin gamemode
if GetButtonPressed == 0
	Player.Equipitem WeapNVServiceRifleBayonet2
elseif GetButtonPressed == 1
	Player.Equipitem Ammo556mm
endif
end

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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