Blockland Forums > Modification Help

Variable Events

Pages: (1/4) > >>

::Matt:::

No, no. It's not VCE.

I'm trying to figure out how to make events similar to VCE, but the variable is already set and cannot be altered.

What I want it to be, is

OnTrigger<Client<IfMoney<___
ifMoneyValid<___<___
ifMoneyInvalid<___<___

Here is my pathetic attempt, basically because I stole snippets of code from AddItem and VCE.

--- Code: ---registerOutputEvent("Player", "AddItem", "datablock ItemData", "Money" 1);

function Player::addItem(%player,%image,%client)
{
for(%i = 0; %i < %player.getDatablock().maxTools; %i++)
{
%tool = %player.tool[%i];
if(%tool == 0)
{
if (%money = Money)
{
%player.tool[%i] = %image;
%player.weaponCount++;
messageClient(%client,'MsgItemPickup','',%i,%image);
break;
else
{
return;
}
}
      }
    }
}

function fxDtsBrick::ifMoneyValid(%brick,%client)
{
$inputTarget_Self = %brick;
$inputTarget_Player = %client.player;
$inputTarget_Bot = %brick.vehicle;
$inputTarget_Client = %client;
$inputTarget_Minigame = getMinigameFromObject(%client);
if(%client.money=>Money);
%brick.processInputEvent("ifMoneyValid",%client);
}
function fxDtsBrick::ifMoneyInvalid(%brick,%client)
{
$inputTarget_Self = %brick;
$inputTarget_Player = %client.player;
$inputTarget_Bot = %brick.vehicle;
$inputTarget_Client = %client;
$inputTarget_Minigame = getMinigameFromObject(%client);
if(%client.money<Money);
%brick.processInputEvent("ifMoneyValid",%client);
}

--- End code ---


Destiny/Zack0Wack0:

I probably shouldn't be helping you but just know that adding money is as simple as
%objthatmoneyisstoredon.money += %amount;
also your syntax is wrong but it's a good start.

::Matt:::


--- Quote from: Destiny/Zack0Wack0 on May 14, 2011, 03:06:20 PM ---I probably shouldn't be helping you but just know that adding money is as simple as
%objthatmoneyisstoredon.money += %amount;
also your syntax is wrong but it's a good start.

--- End quote ---

Yes you probably shouldn't, but I always enjoy your input :) But I still need to know how to put it into events.

::Matt:::

Still need help.

Nexus:

There are like 5 or 6 very basic concepts to scripting that you clearly do not know, broken in your script.

functionality-wise, none of it is correct

syntax wise, it starts to break here:
    if (%money = Money)

What are you trying to do with this?  You don't have a good explaination, and your code makes no sense at all.

Pages: (1/4) > >>

Go to full version