"If you're gonna hardcode the players like that anyway, why not just make an array of the players?"
This isn't my real program, i just wrote it to show an example of my problem. In my real program I won't know how many type objects that will be created.
"The variable count will start at 0 so you will need to use PlayerHealth(1) to get player 2's data."
It doesn't work. PlayerHealth(1) returns 100 (which is player 1's health, as the function is supposed to return)
But I can't get player 2's health.
This isn't my real program, i just wrote it to show an example of my problem. In my real program I won't know how many type objects that will be created.
"The variable count will start at 0 so you will need to use PlayerHealth(1) to get player 2's data."
It doesn't work. PlayerHealth(1) returns 100 (which is player 1's health, as the function is supposed to return)
But I can't get player 2's health.