hit a unit and get an attribute from the hit. pls help to make my game
1 Like
If you want to get points from the unit you hitted, You can do this script. Remember, the trigger must be âwhen a unit gets attackedâ
if (( unit type of ( last attacked unit ) )) == (<unit name>) then
if (( item type of ( triggering item ) )) = (<item name>) then
set <attribute name> of (owner of ( last attacking unit ) ) as ((( <attirbute name> of ( owner of ( last attacking unit ) ) )) + (<number amount>)
-
set fading text of ( triggering unit ) as <name>
You donât need to do step 5 or 6 but if you need to do that, go to step 5 or 6 -
if (( random number between <number> and <number> )) == (number) then
If you want to make a chance to get special points, Repeat step 3 and 4 - You need to watch this first if you want to get levels while hitting a unit
Link: ăModd.io Tutorial #12ăMaking EXP level system - YouTube
If there is something not right, ask me
2 Likes