Here is one of the earliest tribulations I faced 
[quote=“Lothy, post:1, topic:24099”]I can’t figure this out… And to be honest, I have no idea why it doesn’t actually work, but I’m sure it’s something silly I’ve missed.
Please keep in mind that I have spent quite a bit of time searching the forums and google for a tutorial that is relevant, but I havn’t come across one.
This is in my voids section. So basically, when the spell is cast, and it goes to entangle(), a delay of 20 seconds should stop the person moving.
public void entangle()
{
EntangleDelay = 20;
}
This piece of code should make it so that once tangle has been cast on an opponent, the delay of 20 will be counted down 1 second at a time until it hits 0:
if(EntangleDelay > 0)
EntangleDelay -= 1;
Finally, the code below is the actual code for the spell entangle.
As you can see, when the spell is cast, it goes to the public void entangle(). But even though it does this, the delay doesn’t work, and the person can still move.
if(spellID == 1592) // entangle (lvl 79 spell)
{
if(playerLevel[6] >= 78)
{
if((playerHasItemAmount(561, 8)==false) || (playerHasItemAmount(557, 10)==false) || (playerHasItemAmount(555, 10)==false))
{
sendMessage("You do not have enough runes to cast this spell.");
sendMessage("You need 8 "+getItemName(561)+", 10 "+getItemName(557)+" and 10 "+getItemName(555));
}
else if((playerHasItemAmount(561, 8)==true) && (playerHasItemAmount(557, 10)==true) && (playerHasItemAmount(555, 10)==true))
{
stillgfx(179, castOnPlayer.absY, castOnPlayer.absX);
castOnPlayer.entangle();
castOnPlayer.inCombat();
inCombat();
startAnimation(711);
PkingDelay = 40;
deleteItem(561, getItemSlot(561), 8);
deleteItem(557, getItemSlot(557), 10);
deleteItem(555, getItemSlot(555), 10);
teleportToX = absX;
teleportToY = absY;
castOnPlayer.sendMessage("A magical force stops you from moving!");
}
}
else if(playerLevel[6] <= 78)
{
sendMessage("You need a magic level of 79 to cast this spell.");
}
}
Thanks in advance for any help. :)[br][size=1]Posted at: November 11, 2006, 04:36:35 PM[/size][hr]Anybody know?[br][size=1]Posted at: November 11, 2006, 05:59:18 PM[/size][hr]Somebody has to. O.o[/quote]