Author Topic: Changing speed, jumping, in player datablocks  (Read 2326 times)

I want to know how to change the runforce and that stuff within a script without changing the player datablock, if this is even possible.

And I don't mean making a datablock within the script that is a new player type. Sorta just like setting runforce in a existing player datablock ingame.

its pretty easy to do:
DatablockName.somevalue = newNumber;

you just need to find the datablock names and the values you want to change, then add statements to your script.

Now weather it will work the way you want... thats different.

This works fine:
GunProjectile.DirectDamage=100; // 1-shot kill

as to yours - you can try from the console first to see if it does what you want.

its pretty easy to do:
DatablockName.somevalue = newNumber;

you just need to find the datablock names and the values you want to change, then add statements to your script.

Now weather it will work the way you want... thats different.

This works fine:
GunProjectile.DirectDamage=100; // 1-shot kill

as to yours - you can try from the console first to see if it does what you want.


Exactly what I needed. Thank you. Thanks for the extra info too.

Edit: Oh wait, is it possible to set it for whatever player datablock you are using?
« Last Edit: March 29, 2011, 06:07:21 PM by Minnax »


Exactly what I needed. Thank you. Thanks for the extra info too.

Edit: Oh wait, is it possible to set it for whatever player datablock you are using?
sure.. but its better to modify the datablock values once at the beginning and then leave it.  if you have to change the datablock values all the time, then you are doing something wrong.

from the console:
echo( findclientbyname("yourname").player.dataBlock );
<somedbname>

then:
<somedbname>.value = NewValue;

I thought you couldn't change datablocks without having to reload them.

sure.. but its better to modify the datablock values once at the beginning and then leave it.  if you have to change the datablock values all the time, then you are doing something wrong.

from the console:
echo( findclientbyname("yourname").player.dataBlock );
<somedbname>

then:
<somedbname>.value = NewValue;



Well, prehaps I should explain this further.

It is gona be used for my weapon set. Some weapons are heavier than others. When you mount some, I want to it change the value of the datablock you are using, so you can still jet, or use tacknife.

Just make different player datablocks that switch when you equip a gun.

Just make different player datablocks that switch when you equip a gun.

Well, prehaps I should explain this further.

It is gona be used for my weapon set. Some weapons are heavier than others. When you mount some, I want to it change the value of the datablock you are using, so you can still jet, or use tacknife.

There is a reason that people use other datablocks for changing the value of a field when equipping something.

It is becase when you want to change the value of a field of a datablock you will have to
reload them.
This is because datablocks are preloaded.
When you change them, the whole server would have to redownload them.


Well, prehaps I should explain this further.

It is gona be used for my weapon set. Some weapons are heavier than others. When you mount some, I want to it change the value of the datablock you are using, so you can still jet, or use tacknife.
Thats an example of things not working the way you want.

What will happen is that when one person equips a heavy weapon, and your script changes the datablock to slow down that player - EVERYBODY will slow down.  The same datablock is used for all players, so changing the values affects everyone.

Your best option here is to follow picketrocket's advice and make different player datablocks for each weapon type.

Thats an example of things not working the way you want.

What will happen is that when one person equips a heavy weapon, and your script changes the datablock to slow down that player - EVERYBODY will slow down.  The same datablock is used for all players, so changing the values affects everyone.

Your best option here is to follow picketrocket's advice and make different player datablocks for each weapon type.


Yeah, that is what I did, I just wanta to see if it was possible. It seems possible for gravity cat, if you get shot, you slow down a bit, not changing datablock, but prehaps value.

Yeah, that is what I did, I just wanta to see if it was possible. It seems possible for gravity cat, if you get shot, you slow down a bit, not changing datablock, but prehaps value.
Nope, I actually change the datablocks. Changing the values of datablocks would affect the whole server.

Nope, I actually change the datablocks. Changing the values of datablocks would affect the whole server.

Facedesk, once again, i was so close but yet so far.

Nope, I actually change the datablocks. Changing the values of datablocks would affect the whole server.


Hmmm. Ok, I guess ill just have to make every datablock for every playertype I want to make this work with. Is there a arguement for datablocks, to check what datablock you are? I looked, and couldn't find one.

client.player.getDatablock()