How to Make a Class Method Check a Player's Team and Execute Only If They’re Not on a Certain Team

I have this method:

house_props := class<concrete>():
PropDamaged(Agent : agent):void =
set PropHealth -= DamagePerHit
if (PropHealth <= 0):
TargetProp.Dispose()
VFXSpawner.Enable()
PropTracker.SetValue(PropTracker.GetValue() + 1)

I want this to execute only if the player isn’t on team #1 so they can’t damage thire own props but the other teams should be able to.

Idealy if I can have an editable to select the wanted team so I copy the verse device not make a new code for each team that would be great.

I’ve been trying for 2 days so any help is appreciated!
Thanks!

the most simple way to approach it is to make an @editable of the team_settings_and_inventory_device which has the team set as 1 and then in the code to do

if(not MyTeamSetting.IsOnTeam[Agent]):
       CodeHere
1 Like

Thank you thank you thank you!

1 Like

No problem