Author Topic: Calling A Function In A Function  (Read 1696 times)

Code: [Select]
function One(%client)
}
   schedule($Pref::Mod::Time, 0, One, %client);
}
So would this be correct?


function One(%client)
{
   cancel($one::loop);

   echo("-- OMG THIS WORKS --");

   $one::loop = schedule($Pref::Mod::Time, 0, One, %client);
}

to check a players energy would I use a variable with the name of energy?

to check a players energy would I use a variable with the name of energy?
%obj.getEnergyLevel();

%obj.getEnergyLevel();
Thats getting their energy, I need it to do something if their energy is at 100.

Thats getting their energy, I need it to do something if their energy is at 100.
if(%obj.getEnergyLevel() >= 100)

I need it to do something if their energy is at 100.
Code: [Select]
function One(%client)
{
    if(%client.player.getEnergyLevel() == 100)
        schedule($Pref::Mod::Delay, 0, "One", %client);
}
You mean like that?

Code: [Select]
function One(%client)
{
    if(%client.player.getEnergyLevel() == 100)
        schedule($Pref::Mod::Delay, 0, "One", %client);
}
You mean like that?
Would not it need to be like this?
Code: [Select]
function One(%client)
{
    if(%client.player.getEnergyLevel() == 100)
    {
        schedule($Pref::Mod::Delay, 0, "One", %client);
     }
}

Would not it need to be like this?
Code: [Select]
function One(%client)
{
    if(%client.player.getEnergyLevel() == 100)
    {
        schedule($Pref::Mod::Delay, 0, "One", %client);
     }
}
That way is preferred, but both will work.