ArcAngeL Posted April 12, 2019 Share Posted April 12, 2019 Hello Guys ı was enabled friendlyfire for some tests but now ı deleted friendlyfire.But still teams cant kill each other.and ı maked some codes but still teams cant kill each other.what can ı do for this ? local allTeams = getElementsByType ( "team" ) for index, theTeam in ipairs(allTeams) do if ( getTeamFriendlyFire ( theTeam ) == true ) then setTeamFriendlyFire ( theTeam, false ) end end Link to comment
Moderators IIYAMA Posted April 12, 2019 Moderators Share Posted April 12, 2019 Are you sure this code has been executed last? Link to comment
ArcAngeL Posted April 12, 2019 Author Share Posted April 12, 2019 Yes IIYAMA. Really its likr a bug.friendyfire is saved.i did restart server and again teams cant kill each other. Link to comment
Moderators IIYAMA Posted April 12, 2019 Moderators Share Posted April 12, 2019 @ArcAngeL Just to be sure: /start runcode /srun setTeamFriendlyFire ( root, false ) Link to comment
Swagy Posted April 12, 2019 Share Posted April 12, 2019 (edited) You can make your own Friendlyfire code tho which is going to be client sided. function friendlyFire (attacker) if (isElement(source)) and (isElement(attacker)) and (getElementType(attacker) == "player") and (getElementType(source) == "player") then local aTeam = getPlayerTeam(attacker) local sTeam = getPlayerTeam(source) if (aTeam == sTeam) then cancelEvent() end end end addEventHandler("onClientPlayerDamage", root, friendlyFire) Edited April 12, 2019 by UDC 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