<Solved>Altering an object's attribute by a value within the result of a list selection?

I'm trying to make a combat system that functions independently of whatever enemies(or allies), but I'm stuck at applying damage to a target from a menu.
My current code is result.Health = result.Health - player.Damage, which I know is wrong but no idea how to do.


If you're using a menu, then result will be a string.

If you passed a stringlist to ShowMenu, then result will be the text on the list. If you used an objectlist (which I assume you have), then result will be the name of the object, not the object itself.

So you would want something like:

target = GetObject (result)
target.Health = target.Health - player.Damage

Oh, okay, that makes sense, thankyou.


Log in to post a reply.

Support

Forums