Chalwk / HALO-SCRIPT-PROJECTS

:white_check_mark: Halo PC|CE - Add-ons for Phasor V2+ and SAPP :new_zealand:
Other
32 stars 13 forks source link

Vanish [BUG] #83

Closed Dark3211 closed 4 years ago

Dark3211 commented 4 years ago

Bug:

LuaEventCallback >> OnDamageApplication >> Lua Error: [string "vanish"]:1092: attempt to index local 'v' (a nil value)

It is produced:

Occurs when you load the script and activate "vanish mode" on any player. You can deal damage to enemies while in "vanish mode", after the victim (the other players) exit and enter the server, it stops happening and the damage is disabled.

Chalwk commented 4 years ago

Thank you for reporting this bug. I will look into it when able.

Chalwk commented 4 years ago

This mod has been updated with a fix for the 1st bug you mentioned. The second problem you described should have been resolved as a result of fixing the first issue. If you still have any issues, please let me know!

Kind Regards, Chalwk

Dark3211 commented 4 years ago

It didn't work. but change/delete parts of script and it seems to work now.

changes:

function OnDamageApplication(PlayerIndex, CauserIndex, MetaID, Damage, HitString, Backtap)

if (vanish.block_damage) then
    if (tonumber(CauserIndex) > 0 and PlayerIndex ~= CauserIndex) then
        local kip = getip(CauserIndex, true)

        -- 22/04/20 [Fixed nil check error]:
        local k = vanish[kip] or nil
        if (k ~= nil) then
            if (k.enabled) then
                return false
              end
           end
           --
        end
    end
end