Author Topic: Command ClearTools  (Read 305 times)

Hello. Could someone teach me how to do a simple script for my server - a command that clears your tools?

/cleartools would be the command. I wanna learn how to make script functions and stuff.

I mean, I know you start with

function serverCmdCleartools(%this)
{
   something
}

I'm just wondering where to go from there.



You would do something like this:

Code: [Select]
function serverCmdClearTools(%client)
{
%player = %client.player; //ok, we've found their player

if(isObject(%player)) //let's check to make sure that the player actually exists
%player.clearTools(); //clear their tools

messageClient(%client,'',"Your tools were cleared."); //tell them what happened
}

Fyi, post questions about coding in the Coding Help board next time. :)

You would do something like this:

Code: [Select]
function serverCmdClearTools(%client)
{
%player = %client.player; //ok, we've found their player

if(isObject(%player)) //let's check to make sure that the player actually exists
%player.clearTools(); //clear their tools

messageClient(%client,'',"Your tools were cleared."); //tell them what happened
}

Fyi, post questions about coding in the Coding Help board next time. :)

K, thx.