Community Brainstorming for this one (really wish I had a partner or two sometimes!).
So I plan to include a physical item drop on enemy death because well… who doesn’t prefer to see loot explode on the screen instead of just magically appear in your inventory?
While deciding how to handle this event and prevent item theft it occurs to me that kill-stealing is just as much of an annoyance (Blox Fruits anyone). By giving the first attacking player exclusive rights to the XP, Quest Progression, and Loot it’s a win win.
My question is in the roblox setting what do you think would be the “best” method of handling this either in ease of coding or performance script wise? I am very new here and it’s entirely possible I simply overlooked an option or have yet to read thru that page in the massive Hub Documentation listings.
My first thought was to use the same TagEnemy feature most people do for quests, maybe use the datastore to pull the player userID and generate a random tagid then have the XP reward and item lootable only if =playerID & has tag x then leave the tag lingering for enough to for the player to loot before clearing.
It feels messy though and may leave some extra scripts running that could have ended sooner if I handled it better.
Second thought was similar with a twist, I could have each player generate a unique tagID upon entering the server and have the monster upon first loss of HP be “tagged” with that ID and either pass it along for use when time to loot or release/end if hp returns to full.
This adds a tiny complication for cooperative play id have to add a small “group button” to generate another tag to be shared perhaps? If it wasn’t for the performance limitations here this would be a bonus - I could set the npc chase target to the player with the unique tag that just hit it, sadly I dont see that working well from the module handling the targeting/pathfinding of dozens at a time.
Final thought… I could forget the uniqueID requirement for xp / quest / ground loot by granting rewards on first hit to the person/group but leaving them pending until mobdeath and the cloned faux items on the ground, basically just animation at this point, are touched by a player (any player) and vanish. It would still look the same from the player perspective. No idea if it saves any script performance or code work lol. Thought toward the future, PvP might one day be added but it’s not a guarantee this method in particular may leave issues for future me and that guy already doesn’t like me.
thinking Well that’s where I am at the moment just pondering my options before I start coding them in. Open to suggestions, comments, advice, or even feel free to plug some random modules that may handle this. This was one issue that was quite difficult to search for - too many unrelated results on basic tagging just for kill credit.
also thinking Is this an approved use of scripting support? I am technically asking about scripting methods but rather than “its broken fix it” or “I cant figure it out” I am looking for advice on which of the 10 ways I can do something that may be more optimized or some feature in roblox I completely overlooked, hmm.