Solomander Posted December 20, 2015 Share Posted December 20, 2015 I've been trying to add a damage increasing aura to a custom structure I made and so far it hasn't been working. Here is the code I've been using.local function damageaura(inst) local player = GetPlayer() if (player.components.combat then player.components.combat = TUNING.WILSON_DAMAGE_MULT * 666 endendHelp would be much appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/61113-need-help-adding-a-damage-increasing-aura-to-structures/ Share on other sites More sharing options...
Mobbstar Posted December 21, 2015 Share Posted December 21, 2015 First, make a periodic task: inst:PeriodicTask(SECONDS,damageaura) Then, do a distance check in the function: if player and player.components.combat and inst:GetDistSqToInst(player) < RANGE * RANGE then Link to comment https://forums.kleientertainment.com/forums/topic/61113-need-help-adding-a-damage-increasing-aura-to-structures/#findComment-700018 Share on other sites More sharing options...
Solomander Posted December 21, 2015 Author Share Posted December 21, 2015 This is the error i get. Link to comment https://forums.kleientertainment.com/forums/topic/61113-need-help-adding-a-damage-increasing-aura-to-structures/#findComment-700206 Share on other sites More sharing options...
Mobbstar Posted December 22, 2015 Share Posted December 22, 2015 It's meant to be DoPeriodicTask, sorry. I'm getting rusty. Heh. You can look at the game's prefabs for reference. Link to comment https://forums.kleientertainment.com/forums/topic/61113-need-help-adding-a-damage-increasing-aura-to-structures/#findComment-700442 Share on other sites More sharing options...
Solomander Posted December 22, 2015 Author Share Posted December 22, 2015 I got it working, thanks! Link to comment https://forums.kleientertainment.com/forums/topic/61113-need-help-adding-a-damage-increasing-aura-to-structures/#findComment-700450 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