• Reduce fall damage not working, TTT
    2 replies, posted
Ok so i've made 2 lua files that put in a pair of boots that reduce fall damage, the item gets put in but when the player takes fall damage the reduce fall damage script isn't called or working. Please help :) This is the script that adds the boots: [LUA] EQUIP_BOOTS= 8 ---------------------------------------- --- Load the custom equipment. ---------------------------------------- local function AddEquipment() local mat_dir = "VGUI/ttt/" local DescentReductionBoots = { id = EQUIP_BOOTS, loadout = false, -- default equipment for detectives type = "item_passive", material = mat_dir .. "icon_dp_boots", name = "Descent Reduction Boots", desc = "Decreases fall damage by 90%." } table.insert( EquipmentItems[ROLE_DETECTIVE], DescentReductionBoots ) table.insert( EquipmentItems[ROLE_TRAITOR], DescentReductionBoots ) end hook.Add( 'InitPostEntity', 'ttt_AddEquipment', AddEquipment ) [/LUA] And this script is for reducing the fall damage of someone who has bought the boots item. [LUA] if SERVER then AddCSLuaFile("equip_ttt_boots.lua") resource.AddFile( "materials/VGUI/ttt/icon_dp_boots.vmt" ) end if SERVER then local function ScaleFallDamage( ent, inflictor, attacker, amount, dmginfo ) if ent:IsPlayer() and ent:HasEquipmentItem(EQUIP_BOOTS) and dmginfo:IsFallDamage() then dmginfo:ScaleDamage( 0.1 ) end end hook.Add( "EntityTakeDamage", 'ttt_equipment_ironboots_enttakedamage', ScaleFallDamage ) end [/LUA]
Well i've been trying stuff with this but it would seem that the hook is not calling or something, has this changed? [editline]20th April 2013[/editline] -Bump, still very stuck on this not sure whats going on, any sugestions at all?
Right well thanks to the abundance of responses to my problem i was forced to solve this myself, the EntityTakeDamage hook as been shortened to just ( target, dmginfo )
Sorry, you need to Log In to post a reply to this thread.