Blockland Forums > Modification Help

Changing speed, jumping, in player datablocks

Pages: (1/5) > >>

Minnax:

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.

Red_Guy:

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.

Minnax:


--- Quote from: Red_Guy on March 29, 2011, 06:01:21 PM ---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.

--- End quote ---


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?

Red_Guy:


--- Quote from: Minnax on March 29, 2011, 06:05:02 PM ---
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?

--- End quote ---
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;


Deathwishez:

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

Pages: (1/5) > >>

Go to full version