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

D4r4dragon
08 Jun 2021, 00:05I'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.
mrangel
08 Jun 2021, 00:21If 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

D4r4dragon
08 Jun 2021, 01:38Oh, okay, that makes sense, thankyou.