• Stuck -Prop Hunt gamemode
    5 replies, posted
Hello Facepunch community, im trying to make it possible so that the 'Hunter' team can take damage from the enemy team, yet I cant seem to find out how to make it happen. (I'm working on a last prop standing, and this is the final piece i need for the puzzle) Any and all suggestions are helpful!!
Look at some of these hooks, it is likely that gamemode is blocking the damage in one of these hooks: [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerShouldTakeDamage]GM/PlayerShouldTakeDamage[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/ScalePlayerDamage]GM/ScalePlayerDamage[/url] Could you provide a link to the gamemode you are using?
Thank you for your response, this is the one im using: [url]http://steamcommunity.com/sharedfiles/filedetails/?id=417565863[/url] I'm quite the beginner in glua, and im trying to make things for the better EDIT: Love the avatar by the way xD
I downloaded the gamemode and found the hook where the damage is being handled: [code] function EntityTakeDamage(ent, dmginfo) local att = dmginfo:GetAttacker() if GAMEMODE:InRound() && ent && (ent:GetClass() != "ph_prop" && ent:GetClass() != "func_breakable" && ent:GetClass() != "prop_door_rotating" && ent:GetClass() != "prop_dynamic*") && !ent:IsPlayer() && att && att:IsPlayer() && att:Team() == TEAM_HUNTERS && att:Alive() then att:SetHealth(att:Health() - HUNTER_FIRE_PENALTY) if att:Health() <= 0 then MsgAll(att:Name() .. " felt guilty for hurting so many innocent props and committed suicide\n") att:Kill() end end end hook.Add("EntityTakeDamage", "PH_EntityTakeDamage", EntityTakeDamage) [/code] You can see on the third line there is multiple checks depending, mostly, on the attacker and victim. Have a play with them and see if you can get it to work. Edit: The code to edit is in init.lua on line 63
Alrighty, sounds good, thank you!
[QUOTE=DillyTheDill;49818126]Alrighty, sounds good, thank you![/QUOTE] If you have trouble understanding the operators in the code, then take a look here: [url]https://wiki.garrysmod.com/page/Specific_Operators[/url]
Sorry, you need to Log In to post a reply to this thread.