Jump to content

Classic deathmatch teammate


Xwad

Recommended Posts

Just use the code from wiki, the example is doing that what you want...

-- get a table with all teams 
local allTeams = getElementsByType ( "team" ) 
-- for every team, 
addEventHandler("onResourceStart", resourceRoot, 
function () 
for index, theTeam in ipairs(allTeams) do 
    -- if friendly fire is off, 
    if ( getTeamFriendlyFire ( theTeam ) == false ) then 
        -- switch it on 
        setTeamFriendlyFire ( theTeam, true ) 
    end 
end) 

Link to comment

Ok i have read it and did this. Is it so good?

META.XML

teamkill.lua

-- get a table with all teams

local allTeams = getElementsByType ( "team" )

-- for every team,

for index, theTeam in ipairs(allTeams) do

-- if friendly fire is off,

if ( getTeamFriendlyFire ( theTeam ) == false ) then

-- switch it on

setTeamFriendlyFire ( theTeam, true )

end

end

Link to comment

It dosent work:((( i tested it with my friend and he can kill me when we are in one team!:( Have i do something wrong?

META.XML

teamkill.lua

-- get a table with all teams

local allTeams = getElementsByType ( "team" )

-- for every team,

for index, theTeam in ipairs(allTeams) do

-- if friendly fire is off,

if ( getTeamFriendlyFire ( theTeam ) == false ) then

-- switch it on

setTeamFriendlyFire ( theTeam, true )

end

end

Link to comment

Use this..

-- get a table with all teams 
local allTeams = getElementsByType ( "team" ) 
-- for every team, 
addEventHandler("onResourceStart", resourceRoot, 
function () 
for index, theTeam in ipairs(allTeams) do 
    -- if friendly fire is off, 
    if ( getTeamFriendlyFire ( theTeam ) == false ) then 
        -- switch it on 
        setTeamFriendlyFire ( theTeam, true ) 
    end 
end) 

Link to comment

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