Author Topic: Berry script no worky  (Read 770 times)

Im making a berry script for my new RPG but it ends up error at !> 0 or !> 0
Code: ( Berry script, please don't still with out credit) [Select]
registerOutPutEvent(fxDTSBrick, "pickBerry", "", 1);
function fxDTSBrick::pickBerry(%this, %cl)
{
if($Salzberry::RPG::berrys[%cl.bl_id] !> 0)
{
$Salzberry::RPG::berrys[%cl.bl_id] = 1;
messageClient(%cl,'',"\c0Berrys\c6 are \c0"@$Salzberry::RPG::berrys[%cl.bl_id]);
}
else
{
$Salzberry::RPG::berrys[%cl.bl_id]++;
messageClient(%cl,'',"\c0Berrys\c6 are \c0"@$Salzberry::RPG::berrys[%cl.bl_id]);
}
}
function serverCmdEatBerry(%cl, %a)
{
if(%a !> 0 || $Salzberry::rpg::berrys[%cl.bl_id] >= 1)
{
//talk(100-getSubStr(fcbn(pah).player.getDamagePercent(), 2, 5));
%cl.player.addHealh(25);
$Salzberry::rpg::berrys[%cl.bl_id]--;
bottomPrint(%cl,"\c0Berrys\c6 is \c0"@$SalzBerry::rpg::berrys[%cl.bl_id]@" health\c6 is \c0"@100-getsubStr(%cl.player.getDamagePercent(), 2, 5));
}
else
{
if($Salzberry::rpg::berrys[%cl.bl_id] >= %a)
{
%cl.player.addHealth(%a*25);
%CurBer = $Salzberry::rpg::berrys[%cl.bl_id];
$Salzberry::rpg::berrys[%cl.bl_id] = %curBer-%a;
}
else
{
messageClient(%cl, '', "\c6Sorry, \c0"@%cl.name@"\c6 but you need more \c0berrys\c6 you got "@$Salzberry::rpg::berrys[%cl.bl_id]);
}
}
}
EDIT: i found out for !>= i needed to do <=
« Last Edit: December 22, 2009, 01:57:10 PM by Pah1023 »

And that, my friend, is a prime example why you should read some torquescript documentation and try to find your own answers before coming to the forums asking your trivial questions.

The topic stickied at the very top of this very section (coding help) has a document describing all of this.

Please do read it.

I already fixed it, but the eating berry part is messed up but you don't gain more health accept worth of one berry, i would lock this to protect from flame but i know people don't like locked post in coding help :panda:

What would the point of this script be anyways? Just wondering. And also have you tried posting this problem on the Dark Knight forum? Maybe someone can help there too.


Code: ( Berry script, please don't still with out credit) [Select]
Who would want to steal still this crap?

Who would want to steal still this crap?

Shut up just cause people probably flamed you in the past doesn`t mean you have to to me.