• How would i get the affected players of a swep? (for clarification, read the topic)
    6 replies, posted
I am making a swep (in darkrp) that i want to affect everyone but a specific team (TEAM_CC). I have tried this: [lua] function SWEP:dmg(affect_ply) if not (affect_ply:IsTeam(TEAM_CC)) then SWEP.Primary.Damage = 25 else SWEP.Primary.Damage = 0 end end //couldnt get the tabs in here xD(I typed it) [/lua] but it didnt work. How would i get the affected player?
bump
What do you want to get? What do you actually get?
i want to get the team of the player getting affected by the weapon. I am actually getting an error
What error are you getting? post the whole contents of the error.
...What? You are not being very clear here. Affected by what, the damage dealt by an SWEP? The owner of the SWEP?? [editline]25th March 2016[/editline] Additionally, IsTeam is not a function. You need to be doing something like this: [code]affect_ply:Team() == TEAM_CC[/code]
If you look at my attempt, you would see what i meant by affected. Do you not have any ability to analyze or apply logic? The function above attempts to see if the player's team is TEAM_CC. If it is, then the weapon damage would be 0, otherwise it would be 25. Also, Thanks for the info. The "IsTeam" is what was screwing me up. It works now.
Sorry, you need to Log In to post a reply to this thread.