Jump to content
  • 0

how to attach player in a loop while on a specific map?


Question

Posted

Hello guys, I want to make a script that affects every player in one map every X seconds, for example, everyone in the map gets healed/damaged/gets an item, every 3 seconds while on that map. I tried several ways but i  always get player not attached errors.

Also, how can i damage a player and show damage numbers animation?(without using atcommand "@heal -1000"?)
I know we can manipulate a player's hp with "heal", "itemheal" and "percentheal" but this doesn't show any damage animation.

3 answers to this question

Recommended Posts

  • 0
Posted

Use OnPCLoadMapEvent and addtimer

-	script	asdfjkl	-1,{
end;

OnTick:
	getitem itm,itm_qty;
	dispbottom .sec+" second(s) has passed.";
	addtimer .time,"asdfjkl::OnTick";
end;

OnPCLoadMapEvent:
	dispbottom "You have entered a special zone.";
	addtimer .time,"asdfjkl::OnTick";
end;	
OnInit:
	.time = 3000;
	.sec = .time/1000;
	.itm = 501;
	.itm_qty = 1;
end;
}

prontera	mapflag	loadevent

Untested.

  • Upvote 1
  • 0
Posted (edited)
19 hours ago, Hijirikawa said:

Use OnPCLoadMapEvent and addtimer


-	script	asdfjkl	-1,{
end;

OnTick:
	getitem itm,itm_qty;
	dispbottom .sec+" second(s) has passed.";
	addtimer .time,"asdfjkl::OnTick";
end;

OnPCLoadMapEvent:
	dispbottom "You have entered a special zone.";
	addtimer .time,"asdfjkl::OnTick";
end;	
OnInit:
	.time = 3000;
	.sec = .time/1000;
	.itm = 501;
	.itm_qty = 1;
end;
}

prontera	mapflag	loadevent

Untested.

Thank you both for the addtimer idea. and thanks for the script although I did it in other way.

Edited by Brizyous

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...