Is it possible to make a script that if you attack a team member, that he will
get agressive and attack you? your if you make a teamkill and the other teammebers
want to revenge him? Or isn't that possible to make with the swbf2 al?
teamkill script?
Moderator: Moderators
-
RacoonLR
- Second Lance Corporal

- Posts: 105
- Joined: Fri Apr 25, 2014 5:31 pm
- xbox live or psn: No gamertag set
- Location: UNDER YOUR BED
-
Noobasaurus
- Droid Pilot Assassin

- Posts: 2006
- Joined: Tue Aug 17, 2010 5:56 pm
Re: teamkill script?
Yes, it's possible. Just set the killer's team to 4 or something and have team 4 be enemies of the team that he was on before.
-
razac920
- 2nd Lieutenant

- Posts: 365
- Joined: Sun Jan 16, 2011 12:42 am
Re: teamkill script?
Of course!
If friendly-fire is the trigger:
If team-kill is the trigger:
If friendly-fire is the trigger:
Code: Select all
OnObjectDamage(function(object,damager)
if GetObjectTeam(object) == GetCharacterTeam(damager) and GetCharacterUnit(damager) then
SetObjectTeam(GetCharacterUnit(damager),2-GetObjectTeam(damager))
end
end)
Code: Select all
OnObjectKill(function(object,damager)
if GetObjectTeam(object) == GetCharacterTeam(damager) and GetCharacterUnit(damager) then
SetObjectTeam(GetCharacterUnit(damager),2-GetObjectTeam(damager))
end
end)
-
RacoonLR
- Second Lance Corporal

- Posts: 105
- Joined: Fri Apr 25, 2014 5:31 pm
- xbox live or psn: No gamertag set
- Location: UNDER YOUR BED
Re: teamkill script?
Where do I have to put this in?
In the map lua? Sorry i'm new to scripting
In the map lua? Sorry i'm new to scripting
-
razac920
- 2nd Lieutenant

- Posts: 365
- Joined: Sun Jan 16, 2011 12:42 am
Re: teamkill script?
Yes, in your map lua's in data_***/Common/scripts/***/
