General > Developers Corner

Can't get damage returning to work...

<< < (2/2)

MrPresident:
Unless the prop was launched with the gravity gun, there is no way to get the player that "threw" it.

LuaTenshi:

--- Quote from: MrPresident on February 27, 2014, 07:49:00 PM ---Unless the prop was launched with the gravity gun, there is no way to get the player that "threw" it.

--- End quote ---

Yeah but getting the owner of the prop is the next best thing and that is what I am doing, I know that this can be problematic but I provide the option to turn it off so...
But yeah I can't get it to deal damage to the owner of the prop when that prop hits a player, for some reason it always comes back as 0.

JamminR:
Line 196 - You define 4 variables with only 3 functions. You never assign 'odmg' variable anywhere that I can find.
So, it comes back (nil or 0?) when you attempt to use it in lines 234 and 235?
Plus what MrP says?
(Please forgive me if I'm no where close...it's truly been many years since I've coded Glua directly)

MrPresident:
I looked at your pastebin and debug output and I agree with what JamminR says. You are trying to use odmg without properly defining it. It will always return 0 or nil.

Navigation

[0] Message Index

[*] Previous page

Go to full version