Blockland Forums > Modification Help

How would you make it so you can switch to a different datablock by pressing the

Pages: << < (3/6) > >>

Sgt. A Walter:


--- Quote from: Uristqwerty on November 30, 2010, 04:17:29 PM ---What you want is a weapon that toggles between doing different things when you press a button? You can swap the model, or do something fancy with image states based on the loaded and ammo image flags, or you could find a better way to accomplish what you want, like directly responding to triggers and servercmds without changing how the weapon works.

--- End quote ---
Yes I wan't it to switch from blablabla.cs to yadayada.cs when I click the R key, what I am trying to find out is the actual script.

Uristqwerty:

You can't. The datablock is defined the first time the file is run, and then it doesn't matter what file created the datablock, it's still the datablock for a weapon. Furthermore, altering the datablock would change it for everyone using the gun at the moment, if the engine will even allow you to alter it.

You could just give the player an identical looking image with a different datablock(that is modified to do something different when it fires), but I suspect that there is a better way to do what you intend it to do.

Also, you cannot make something serverside controlled by a specific key for the clients, you can only make it respond to keys they already use, like the light key, or the paint key, or jumping, crouching, jetting, etc.. Or a /command, or a client add-on that adds a new key that the server can respond to.

Sgt. A Walter:


--- Quote from: Uristqwerty on November 30, 2010, 05:49:14 PM ---You can't. The datablock is defined the first time the file is run, and then it doesn't matter what file created the datablock, it's still the datablock for a weapon. Furthermore, altering the datablock would change it for everyone using the gun at the moment, if the engine will even allow you to alter it.

You could just give the player an identical looking image with a different datablock(that is modified to do something different when it fires), but I suspect that there is a better way to do what you intend it to do.

Also, you cannot make something serverside controlled by a specific key for the clients, you can only make it respond to keys they already use, like the light key, or the paint key, or jumping, crouching, jetting, etc.. Or a /command, or a client add-on that adds a new key that the server can respond to.

--- End quote ---
So similar code to the sight stuff I get it, but how do I make it three ir even four way? And what do i change from sights scripts to make it say... the brick key?

phflack:

i don't think you can do it by a key, as that would be client sided, which means you'd have to use another input, like /light, which is by default keybound

PhireX7:

You could change the weapon to a different weapon all together. I know thats possible. But is it possible to keep the same mounted model and only change the weapon that it is referring to?

Pages: << < (3/6) > >>

Go to full version