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