Goregonzola Posted January 2, 2021 Share Posted January 2, 2021 Happy New Year everyone! As the title says, is there any way to add a damage aura to my custom survivor, so nearby mobs take some damage? It would be the best if it wouldn't affect other players, just mobs. Thanks in advance! Have a great day! Link to comment Share on other sites More sharing options...
penguin0616 Posted January 5, 2021 Share Posted January 5, 2021 You'd probably want to do a periodic loop where you find all the entities with a health (probably combat too) tag, and damage them. Very rough example: player:DoPeriodicTask(time, function() local victims = TheSim:FindEntities(...) for i,v in pairs(victims) do -- you can either attack by doing it through Health:DoDelta or Combat:GetAttacked. Health is the simplest way since it ignores game mechanics, Combat:GetAttacked accounts for game mechanics (armor, aggro, etc) end end) You can find examples of TheSim:FindEntities in the game files. 1 Link to comment Share on other sites More sharing options...
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