Jump to content

Teamkill script not working


Xwad

Recommended Posts

Hi the disable teamkill script is not working. Please help!

teamkill.lua

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

meta.xml

Link to comment

XDD is it now good?

-- 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 ) == true ) then

-- switch it on

setTeamFriendlyFire ( theTeam, false )

end

end)

Link to comment

i checked the log and it wrote this

[2015-02-14 11:18:29] Starting teamkill

[2015-02-14 11:18:29] SCRIPT ERROR: teamkill\teamkill.lua:12: unexpected symbol near ')'

[2015-02-14 11:18:29] ERROR: Loading script failed: teamkill\teamkill.lua:12: unexpected symbol near ')'

Link to comment

[2015-02-14 11:23:38] SCRIPT ERROR: teamkill\teamkill.lua:12: 'end' expected (to close 'function' at line 5) near ''

[2015-02-14 11:23:38] ERROR: Loading script failed: teamkill\teamkill.lua:12: 'end' expected (to close 'function' at line 5) near ''

Link to comment
  
-- 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 ) == true ) then 
-- switch it on 
setTeamFriendlyFire ( theTeam, false ) 
end 
end 
end) 
  

one end is missing

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