ArcAngeL Posted April 12, 2019 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
Moderators IIYAMA Posted April 12, 2019 Moderators Posted April 12, 2019 Are you sure this code has been executed last?
ArcAngeL Posted April 12, 2019 Author 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.
Moderators IIYAMA Posted April 12, 2019 Moderators Posted April 12, 2019 @ArcAngeL Just to be sure: /start runcode /srun setTeamFriendlyFire ( root, false )
Swagy Posted April 12, 2019 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
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