Jump to content

help


Recommended Posts

Posted

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.

Posted
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 ) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
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.

Posted

-- 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

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...