Forum Discussion
16 Replies
- LadyMo218MHCP Member
Looking back over, this wouldnt work. The trigger would become enabled but it would still be sitting under the world somewhere and never triggering the explosion because it wouldn't be receiving a player. So what about this:
- gausrothMHCP Mentor
There is a chance that the grenade will still be moving after detonate has been called. But this seems to be more like a mine than a grenade. I would call the grenade event right after the detonate and you don't even need the trigger.
- LadyMo218MHCP Member
So would I move “connect grenadeTrig” event down under when “detonate is received” rather than when world is started?
- Biggie_PaulsMeta Employee
In Desert Sand PVP I run a While loop on detonation to check the distance from each player's position in the world, if their position is within the range of the blast, I send the applyDamage event to that player. This also gives you flexibility to set different distances to be able to apply different amounts of damage depending on how close to the blast they are adding a bit more realism.
- LadyMo218MHCP Member
Lol of course you both would suggest something that’s above my pay grade 😆😆😆
- gausrothMHCP Mentor
I'm thinking it would look something like this.
- Biggie_PaulsMeta Employee
I apologize for not being thorough, I thought it was implied that I was iterating through the list. I was answering your question as to what the check was within the while loop. You are absolutely correct, you must use an iterator. I also scripted this 2 years ago and those while loops are probably pretty bulky. I try not to have too many lines in there which is why I just check for the distance from the player to the blast position and send the event out to calculate appropriate damage in the subsequent event.
- LadyMo218MHCP Member
🤯