Okay 2 things to say...
(1) Thanks for the help Ply but I'm fairly new to scipting and I have next to no idea on how to make and use variables so I'll need a bit of help with that if it's okay (maybe with an example script or even better if you could show me what to do with the variables with my script shown in the next paragraph, then put brackets around the things you edited explaining how to do it so I can do it myself next time).
(2)The reason why I initially asked is because I'm editing a "pickupweapon" script made by DealDeath and given out free, so that in my version when the player walks up to a weapon, it makes a HUD saying press F to take weapon or ENTER to swap currently held item. Then it replaces the weapon if the player pressed enter, and if there is enough space in the inventory (variable problem), the player can just take it. then it has the weapon taken confirmation HUD, plays a sound and the player can walk away, hooray!
So far I have edited the script so it does the same thing as the original (shows "press enter to take weapon", player presses enter, weapon is put in players inventory, sound played and walk away.) except it is written differently.
here is the original script (DealDeath's script):
;Artificial Intelligence Script
;Header
desc = Weapon Pickup
;Triggers
:state=0,plrdistwithin=40:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\entertakesweapon.dds,hudname=weaponprompt,hudmake=display,state=1
:state=1,scancodekeypressed=28:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupaweapon.tga,hudname=weaponprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=40:state=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt
;state=2:state=3,playerdrop,colon,plrsound=audiobank\items\pickup.wav
:state=3,plrdistfurther=65:state=10
;By DealDeath
;End of Script
And here is my unfinished edited version (made it do the same thing):
;Artificial Intelligence Script
;Header
desc = Weapon Swap
;Triggers
:state=0,plrdistwithin=40:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\entertakesweapon.dds,hudname=swapweaponprompt,hudmake=display,state=1
:state=1,scancodekeypressed=28:hudfadeout=swapweaponprompt,hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupaweapon.tga,hudname=swappedweaponprompt,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=40:state=1,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,hudshow=swappedweaponprompt,hudfadeout=swappedweaponprompt
;state=2:state=3,playerdrop,colon,plrsound=audiobank\items\pickup.wav
:state=3,plrdistfurther=65:state=10
;By DealDeath-Edited by JimmySlayer
;End of Script
If anyone can give me a bit of help that would be great. And if you want the script to edit yourself feel free if it helps you, but if you got near what I want to achieve it would be nice to help me do it. (If you use the script for your commercial games I don't mind and DealDeath gave his out for free so he's okay.)
Thanks heaps guys!
EDIT: do i need the "colon/coloff (collision) and decal parts of the script?