Scripts / Weapon pickup no "E"

Author
Message
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 5th Jan 2020 23:56
Is there a way to make the weapons so that the player does not have to hit the "E" key to pick them up?
It just seems a more seamless gaming experience if the player could just run through them and pick them up.
PM
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 6th Jan 2020 00:08 Edited at: 6th Jan 2020 00:09
replace with :

if PlayerDist < 80 and g_PlayerHealth > 0 then

should works--- not tested

PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 6th Jan 2020 02:27
Added the script and started the level and walked through the weapon.
Nothing happened.
I do appreciate the effort though.
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 6th Jan 2020 02:40
You should be able to do it by slightly adjusting the ammo pickup script to a weapon.
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 6th Jan 2020 02:43
Scripting is not my strong point.
I tried it.
It wasn't pretty.
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Jan 2020 04:12
@ Incenseman2003
Try code below. It works for me.



Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 6th Jan 2020 05:15
Is there anything in this script that I have to change?
It does not work as is and it looks like the same one that JC LEON posted.
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Jan 2020 12:12
Quote: "Is there a way to make the weapons so that the player does not have to hit the "E" key to pick them up?"

Quote: "Is there anything in this script that I have to change?"

Just replace your weapon.lua with mine.

Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 6th Jan 2020 14:43 Edited at: 6th Jan 2020 15:34
I did exactly what your video shows.
Unfortunately I did not get the same results.
I did notice in your video that the script file has the name as simply weapon.lua.
I put it in it's own folder and changed the name of the file to that and now it works.
Thank you all so much.
It's awesome!!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Jan 2020 15:55
Quote: "I did notice in your video that the script file has the name as simply weapon.lua.
I put it in it's own folder and changed the name of the file to that and now it works."

might want to read line 1 of the script - you'll find it in most stock scripts as it's very important
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Jan 2020 16:26
Glad you sorted out.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Incenseman2003
6
Years of Service
User Offline
Joined: 4th Nov 2018
Location:
Posted: 6th Jan 2020 18:11
I did read the first line of the script.
However the wording of it made me unsure exactly what it meant.
Now that I know what it means it makes sense.
PM

Login to post a reply

Server time is: 2024-12-22 09:23:37
Your offset time is: 2024-12-22 09:23:37