marty000123 Posted August 24, 2014 Share Posted August 24, 2014 (edited) Hey I'm looking for a script with the following features: We got a spawn script which has Town > Category > Class. For example, Military Forces > US Army > Soldier. But for some reason, the US Army always kills the SWAT team.. ( Military Forces > S.W.A.T > S.W.A.T Soldier ) So I am looking for the script which makes players unable to kill SWAT as Army and to kill Army as SWAT. So it's a kinda alliance between Categories. So Military Forces > US Army > .. won't be able to kill Military Forces > US Army > .. and vice versa! ( Category can be seen as Team, so it will be like Town > Team > Class ) Thanks in advance!!! Marty Edited August 24, 2014 by Guest Link to comment
SkatCh Posted August 24, 2014 Share Posted August 24, 2014 no one will create something like that for free , you can use those function : "getTeamName" "getPlayerTeam" "onClientPlayerDamage" etc ... i will make it easy for you , example army can't kill swat. addEventHandler( "onClientPlayerDamage", root, function ( theAttacker ) if ( isElement( source ) ) and ( isElement( theAttacker ) ) then --- check if is element ... if ( getElementType(theAttacker) == "player" ) then if ( getTeamName( getPlayerTeam( theAttacker ) ) == "Army" ) and ( getTeamName( getPlayerTeam( source ) ) == "SWAT" ) then --- check teams cancelEvent() end Link to comment
marty000123 Posted August 24, 2014 Author Share Posted August 24, 2014 I see, and I tried it out and it didn't work I think it was just a test thing? Well, may I know your skype ID so I can add you there? We could talk there about this script. Marty Link to comment
Mr_Moose Posted August 24, 2014 Share Posted August 24, 2014 That's pretty much all you need, just modify the if statement after your own conditions. 'theAttacker' is the player who attacked you and the source is the victim, you may also add this: ... source == localPlayer ... in your if statement to verify that the victim and local player actually are the same and that this event is cancelled for the correct player. Link to comment
WASSIm. Posted August 24, 2014 Share Posted August 24, 2014 WTF you scriped spawn system and you can't script this ? i think you'r use leaked resource Link to comment
marty000123 Posted August 25, 2014 Author Share Posted August 25, 2014 WTF you scriped spawn system and you can't script this ? i think you'r use leaked resource My old scripter scripted it but he left so yeah.. Link to comment
Anubhav Posted August 25, 2014 Share Posted August 25, 2014 addEventHandler( "onClientPlayerDamage", root, function ( theAttacker ) if isElement( source ) and isElement( theAttacker ) then --- check if is element ... if getElementType(theAttacker) == "player" then if getTeamName( getPlayerTeam( theAttacker ) ) == "Army" and getTeamName( getPlayerTeam( source ) ) == "SWAT" then --- check teams cancelEvent() end end end end 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