Xwad Posted February 12, 2015 Posted February 12, 2015 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
Castillo Posted February 12, 2015 Posted February 12, 2015 You are enabling the ability to kill your team mates, not disabling it.
Xwad Posted February 12, 2015 Author Posted February 12, 2015 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)
JR10 Posted February 13, 2015 Posted February 13, 2015 Use [lua] tags and read this: viewtopic.php?f=91&t=47897
Xwad Posted February 13, 2015 Author Posted February 13, 2015 its not working:( maybe have i do something wrong in the meta? "Xwad" type="script"/>
xeon17 Posted February 13, 2015 Posted February 13, 2015 Everything is correct , are you sure it doesn't work?
Xwad Posted February 13, 2015 Author Posted February 13, 2015 yes i'm sure. I started the CDM gamemode and test it and dosent work:(
JR10 Posted February 14, 2015 Posted February 14, 2015 Any errors in /debugscript 3? Where do you create the team? Before or after the resource is started?
Xwad Posted February 14, 2015 Author Posted February 14, 2015 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 ')'
Xwad Posted February 14, 2015 Author Posted February 14, 2015 [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 ''
xeon17 Posted February 14, 2015 Posted February 14, 2015 just add an "end" to close the function as the debug said
ma2med Posted February 14, 2015 Posted February 14, 2015 -- 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
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