Author Topic: Need help scripting.  (Read 6330 times)

%player.getMountedObject(%slot);

Note that whatever comes before "getMountedObject()" should be a player of some sort. So you could also do

%client.player.getMountedObject(%slot);
FindClientByName(blockhead).player.getMountedObject(%slot);

also, doing a function on a player simply sets the first variable in the function as the player. So, really, you could do

getMountedObject(%player, %slot);

but the most common method is the first kind.

EDIT:

By the way, %slot is what body part to check.

For example, 0 is your left hand which pretty much every item in the game is held in.
Play around with it to figure out the rest.
« Last Edit: June 28, 2012, 04:19:32 PM by Wheatley »

%player.getMountedObject(%slot);

Note that whatever comes before "getMountedObject()" should be a player of some sort. So you could also do

%client.player.getMountedObject(%slot);
FindClientByName(blockhead).player.getMountedObject(%slot);

also, doing a function on a player simply sets the first variable in the function as the player. So, really, you could do

getMountedObject(%player, %slot);

but the most common method is the first kind.

EDIT:

By the way, %slot is what body part to check.

For example, 0 is your left hand which pretty much every item in the game is held in.
Play around with it to figure out the rest.
Why is 1 not your right hand? Or well its not working.

also, doing a function on a player simply sets the first variable in the function as the player.

That isn't true, for example:

%player.setTransform(%position);


Now this isn't even a real function below:

setTransform(%player,%position);

Why is 1 not your right hand? Or well its not working.
Code: [Select]
%player3 = %client.player.getMountedObject(1);Why does that return with nothing when someone is mounted my hand?
« Last Edit: June 28, 2012, 05:28:02 PM by zefoo »

That isn't true
Nope, nope, and nope.
It is true.

For any sort of object, the first argument for any method in that object is the object that the function is being called on.
Example of a object function:
function GameConnection::autoAdminCheck(%this)

%this is set to the object it is being called upon, so if you did %client.autoAdminCheck(), it would set %this to %client.
Note that it doesn't have to be named %this, but it's common practice for non-client related functions.

Nope, nope, and nope.
It is true.

For any sort of object, the first argument for any method in that object is the object that the function is being called on.
Example of a object function:
function GameConnection::autoAdminCheck(%this)

%this is set to the object it is being called upon, so if you did %client.autoAdminCheck(), it would set %this to %client.
Note that it doesn't have to be named %this, but it's common practice for non-client related functions.

That's not what I am saying, of course the first arg is going to be the object itself. He was saying that you can call the object's function without the namespace so to speak and add that object into it, instead of calling the object's function with the namespace. (atleast that's how i read it) Which is why I responded with:

That isn't true, for example:

%player.setTransform(%position);


Now this isn't even a real function below:

setTransform(%player,%position);

« Last Edit: June 28, 2012, 05:58:21 PM by elm »

He was saying that you can call the object's function without the namespace so to speak and add that object into it, instead of calling the object's function with the namespace.
Ohhhh, okay.
Nevermind then :p

That isn't true, for example:

%player.setTransform(%position);


Now this isn't even a real function below:

setTransform(%player,%position);


Alternately, this works, however: player::setTransform(%player, %transform);

How would you see if a key was pressed?
Like how would i see if the player pressed W?

How would you see if a key was pressed?
Like how would i see if the player pressed W?
That would only work if they had a keybind set to W and that keybind sent some command to the server

Why does blockland crash when I use
Code: [Select]
CommandToServer(CommandHere);or
Code: [Select]
CommandToAll(CommandHere);?

Why does blockland crash when I use
Code: [Select]
CommandToServer(CommandHere);or
Code: [Select]
CommandToAll(CommandHere);?
Are you using Apostrophes
Someone correct me if im wrong here but cant that lead to a crash

Code: [Select]
commandToServer('CommandHere');Is the correct way to call it.
« Last Edit: June 29, 2012, 09:07:32 PM by Eeposs »

Are you using Apostrophes
Someone correct me if im wrong here but cant that lead to a crash

Code: [Select]
commandToServer('CommandHere');Is the correct way to do that.
Ooohhhh lol thanks
« Last Edit: June 29, 2012, 09:38:30 PM by zefoo »

Can you make your character move forward or something with a script?
Like could you do something like this
Code: [Select]
player.moveforward();or this
Code: [Select]
//Find keybind of forward.
//Set %bind to keybinds letter
client.sendkeys(%bind);
?

Clientside or serverside? Clientside is moveForward(1); serverside isn't quite possible so easily.
« Last Edit: June 30, 2012, 08:47:47 PM by Slicks555 »