yesyesok Posted May 15, 2015 Posted May 15, 2015 Hey, I'm using the tactics gamemode, I was trying make the team tactics have godmode and the way to kill them is when players shoot at thier left arm (id 5). what should i do, if possible please post it with example, cuz i can't understand how to do that. team tactics cannot die with any weapon but when the weapon hits their left arm they lose 60% hp.
Walid Posted May 15, 2015 Posted May 15, 2015 Hey, I'm using the tactics gamemode, I was trying make the team tactics have godmode and the way to kill them is when players shoot at thier left arm (id 5).what should i do, if possible please post it with example, cuz i can't understand how to do that. team tactics cannot die with any weapon but when the weapon hits their left arm they lose 60% hp. Try this one function TacticsDamage ( attacker, weapon, bodypart ) local playerTeam = getPlayerTeam(source) if (playerTeam) then if getTeamName(playerTeam) == "tactics" then if (bodypart == 5) then local health = getElementHealth (source) - 60 setElementHealth (source,tonumber(health)) else cancelEvent() end end end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), TacticsDamage )
yesyesok Posted May 15, 2015 Author Posted May 15, 2015 thanks You are welcome. one more question this isn't working, I WAS TRYING TO SET army teams heath 15 when they spawn but it isn't working. Sorry if i'm asking too many questions. addEventHandler ( "onPlayerSpawn", getLocalPlayer(), function() local playerTeam = getPlayerTeam(source) if (playerTeam) then if getTeamName(playerTeam) == "Army" then setElementHealth (source,15) end end) and one more thing how do i make army team players not being able to pick up sniper and ak47.
Walid Posted May 15, 2015 Posted May 15, 2015 -- First question addEventHandler ( "onPlayerSpawn", root, function() local playerTeam = getPlayerTeam(source) if (playerTeam) then if getTeamName(playerTeam) == "Army" then setElementHealth (source,15) end end end) -- Seconds question local weapons = {[30] = true,[34] = true} function whenPlayerHitPickUp ( thePlayer ) local pickupType = getPickupType ( source ) if (pickupType == 2) then local weapon = getPickupWeapon ( source ) if weapons[weapon] then cancelEvent() end end end addEventHandler ( "onPickupHit", getRootElement(), whenPlayerHitPickUp ) Note: next time try to do it by yourself before you start looking for help
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now