Best way of handling sword equipment from database in one main script (maybe more if needed for the solution)
Greetings, fellow community developers! I’ve hit an issue with my sword fighting game, where I’ll have to properly give all players their equipped swords at the same time. This is relying on a default datastore table for each indiviual, looking like this:
PlayerInv = {
["Swords"] = {"Sword1"}; -- could be multiple swords
["Equipped_Sword"] = {"Sword1"}; -- will always be one sword
["Boosts"] = {}
}
I’m thinking of using pcall(function()
with DataBase:GetAsync
to all players in the server using a for loop, however this might be bad and will probably - by my knowledge - end up causing too many requests at once.
All of the actual sword equipment will happen in a serverscript, which is why I’ll probably have to use a method with a for loop. There cannot be much wait()
time, as this can cause the round selection to slow down and eventually run everything at inconsistent speeds.
Any code can help solving this problem. Thanks in regards.- Dev_Mathe