Help with making a enity/player fire proof and Explosive proof
4 replies, posted
i cant seem to find a way to make a player not take damage from fire and explosives, could some one help me?
Thank you all so much
[code]hook.Add("EntityTakeDamage", function( target, dmginfo )
if ( target:IsPlayer() ) then
if dmginfo:IsExplosionDamage() or dmginfo:IsDamageType(DMG_BURN) then -- check its burn or explosion.
dmginfo:ScaleDamage( 0 ) -- no damages
end
end
end)
[/code]
[QUOTE=coderfather;52735183][code]hook.Add("EntityTakeDamage", function( target, dmginfo )
if ( target:IsPlayer() ) then
if dmginfo:IsExplosionDamage() or dmginfo:IsDamageType(DMG_BURN) then -- check its burn or explosion.
dmginfo:ScaleDamage( 0 ) -- no damages
end
end
end)
[/code][/QUOTE]
it didnt work :L [ERROR] attempt to index local 'dmginfo' (a nil value)
Instead of using ScaleDamage just return true and make sure you're running the script on the server.
[QUOTE=txike;52735204]Instead of using ScaleDamage just return true and make sure you're running the script on the server.[/QUOTE]
i will give it ago
[editline]1st October 2017[/editline]
i got there in the end
Sorry, you need to Log In to post a reply to this thread.