Forum

> > CS2D > Scripts > shotgun script Q. for HL2D mod
Forums overviewCS2D overview Scripts overviewLog in to reply

English shotgun script Q. for HL2D mod

6 replies
To the start Previous 1 Next To the start

old shotgun script Q. for HL2D mod

Phenixtri
User Off Offline

Quote
Hello guys im thinking about making a script for the xm1014 weapon as its replaced with my combat shotgun skin for HL2D & I was wondering if its possible to create a time lag between shots.

Not altering the weapons rate of fire just making a 1-1.5 sec time delay between shots so once the player fires primary (default left mouse button) he cant fire again for the 1 or 1.5 sec. delay.

The other part of the script is the secondary fire mode activated with the right mouse button.

The alt fire would hold the fire button down for 2 shots only & also have another time lag after that for 2 to 2.5 sec. The alt fire mode would also use a different fire sound as well.

In this way im hoping to create a shotgun that mimics the half life shotgun & its features.

And please don't be an ass when replying. If you cant comment constructively then don't comment at all.

old Re: shotgun script Q. for HL2D mod

Phenixtri
User Off Offline

Quote
NOT by altering the weapons rate of fire. I was thinking more along the lines of having the fire button unusable IE primary fire would not be usable by the player after firing one shot for 1 to 1.5 sec.

Basically a lua for the fire control only not the weapons rate of fire which is hard coded.

old Re: shotgun script Q. for HL2D mod

Phenixtri
User Off Offline

Quote
Hard but still possible right? And yea im a bit eccentric

Its just the only way I can think of making a HL like shotgun for HL2D & since im no expert in lua I thought it would be best to ask some pros 1st

old Re: shotgun script Q. for HL2D mod

Flacko
User Off Offline

Quote
Phenixtri has written
NOT by altering the weapons rate of fire. I was thinking more along the lines of having the fire button unusable IE primary fire would not be usable by the player after firing one shot for 1 to 1.5 sec.

Basically a lua for the fire control only not the weapons rate of fire which is hard coded.


Your Lua questions are starting to get a little bit annoying >_<

That is absolutely not possible, because you're talking about changing the input's behaviour, which is obviously client-sided.
Lua scripts run only on the server side.
You should also read a Lua manual/documentation/tutorial because I think you've got the wrong idea about it.

Firing Delay -> Not possible, you can't change a weapon's fire rate nor you can affect the user input's behaviour.

Secondary Attack -> Not possible, either. Since none of the shotguns in the game have a secondary fire, it's impossible to find out when the user has pressed the right mouse buttom.
Moreover, it's impossible to simulate shots in a realistic way through Lua.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview