So, i'm working on an event where each click, the brick's gold gets decreased by 1 (starts at 5) and the player's gold gets increased by 1 (starts at 0). But the player's gold will just stay at 1 and the first click, the brick dissapears.
function fxDTSBrick::Gold(%this,%client)
{
if($Pref::Server::RPGMod::Enabled==1)
{
%client.goldAmount++;
%this.goldAmount-=1;
if(%client.goldAmount=1)
{
messageClient(%client,'',"\c6You now have \c21\c6 peice of gold. The block now has \c24\c6 peices of gold.");
%this.goldAmount=4;
}
if(%client.goldAmount>=2)
{
messageClient(%client,'',"\c6You now have \c2"@%client.goldAmount@"\c6 peices of gold. The block now has \c2"@%this.goldAmount@"\c6 peices of
gold.");
}
if(%this.goldAmount=4)
{
%this.delete();
}
}
}
Please help!