• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

If 2 players are attacking you set storage

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Hi
I have a little problem with teleporting rune.I want to set you cant teleport when 2 or more players attack/target you. I was trying something with onstatschange and statchange_healthloss but i dont know how to check number of players.
thanks and sorry for my poor english :S
 
Create a onStatsChange script, check if attacker is a player.
Set up 4 empty storages, 2 of them store players, 2 of them the time.
When a player attacks check both player storages if the player still exists or if one of those stored players is the attacking one.
If the attacker is already stored just update the time storage, if the attacker is not stored store him in the storage values that is further back in time.

If you want to check in your teleport script if the player is attacked by 2 or more you have to check if both storages (which store time) are close to os.time.
 
Back
Top