Lua Weapon Variable Damage [uh, Solved already?]
Posted: Sun Jul 10, 2011 12:34 am
I'm trying to make a cannon to be fired by a vehicle or turret against other vehicles, turrets, whatever really, that does a different amount of damage each shot, specifically so as you keep shooting it, it becomes less effective to a target if you keep hitting it.
I started with a chunk of LUA that detects a weapon hit, and heals the attacker, and I've changed it, to damage the attacker in the way I mentioned, but I'm not sure how to make it damage the target instead. I'm not sure the GetCharacterUnit line will work, because the target might not be a "Character"?
EDIT: Well, that was easy...
New code that works if anyone likes it.
I started with a chunk of LUA that detects a weapon hit, and heals the attacker, and I've changed it, to damage the attacker in the way I mentioned, but I'm not sure how to make it damage the target instead. I'm not sure the GetCharacterUnit line will work, because the target might not be a "Character"?
Hidden/Spoiler:
New code that works if anyone likes it.
Hidden/Spoiler: