thisbecasper, on 28 October 2017 - 01:40 AM, said:
For damage data, you have to look at the player's sprite, not the player number. The sprite number of a player is the value of player[THISACTOR].i
When you are accessing a player via their player number, but you want information about their sprite, you can grab that sprite ID and then dig into the sprite data.
You could try using this code to populate an array with the player health values:
gamearray playerhealth 8 gamevar temp 0 0 gamevar temp2 0 0 appendevent EVENT_GAME ifactor APLAYER { getactor[THISACTOR].yvel temp getactor[THISACTOR].extra temp2 setarray playerhealth[temp] temp2 } endevent
And then at any point in your code, you can setvarvar <varname> playerhealth[PLAYER#]
Alternatively, you can skip the new array, and at any time use:
getplayer[PLAYER#].i temp
getactor[temp].extra temp2 // where temp2 is the health value