Gothic Online Forums
Timer problem... - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Scripting Help (https://archive.gothic-online.com/forum-12.html)
+--- Thread: Timer problem... (/thread-44.html)



Timer problem... - Jayson - 11.10.2015

Code:
function Verbluten()
{
local health = getHealth();
if (health < 31)
{
   setHealth(health - 5);
    addMessage(255, 0, 0, "Du verblutest langsam!");
    addMessage(255, 0, 0, "Besorg dir besser etwas zum Regenerieren!");
    }
    else
    {
    if (health > 30)
    killTimer(Verbluten);
}
}

// The Problem is, when he goes from 29-32 HP he become the -5 HP :/

function ANTIAFK()
{
local health = getHealth();
if (health > 89)
    setExperience(getExperience + 100);
    {
    else
    }
if (health < 90)
addMessage(255, 0, 0, "Du hast wenig Leben und bekommst deshalb keine Erfahrung!");

}


// here is the problem, that we wont accept "+".
I hope anyone can help Smile


RE: Timer problem... - Profesores - 11.10.2015

What's the problem in first function? Cause I don't understand, everything looks good.

The second problem - getExperience is a function, so you must to add brackets after that.


RE: Timer problem... - Jayson - 11.10.2015

The problem at the first ist, when im under 30 HP, ill lost 5 HP. Thats right. But when i eat some, and go over 31, i still lost -5 HP.

At the second . Its like this?
I dont understand.


Code:
setExperience(getExperience) + 100);



RE: Timer problem... - Profesores - 11.10.2015

The first problem sounds like Gothic Online bug. You must to wait for Bimbol.

About the second:
Squirrel Script
  1. setExperience(getExperience() + 100);





RE: Timer problem... - Jayson - 11.10.2015

Oh right...-.-
Thanks mate Smile.

@Bimbol please help Smile


RE: Timer problem... - Sative - 12.10.2015

You can also use onRender or onTick callback with getTickCount function.


RE: Timer problem... - Jayson - 15.10.2015

Ok ill try Smile

thanks