Hi, I recently posted a topic about how to get all the players that joined a game in the last week. That seems to work, however, I ran into a new problem and wasn’t sure if I should’ve just asked the person who helped me or?
Anyways, so the problem is I am trying to get all strings from a Table. I can’t find a topic about it ?
The table:
local CurrentWeekData = DSS:GetOrderedDataStore(CurrentWeek):GetSortedAsync(false, 10)
local CurrentWeekPlayers= CurrentWeekData:GetCurrentPage(false, 10) --10 is the page size
What i’m trying to do:
["description"] = ""..CurrentWeekPlayers
I thought I would use that? I tried doing "CurrentWeekPlayers[1,2,3,4,5,6,7,8,9,10] but obv, that doesn’t work.
Just store the userids of the players who played last week in a datastore, and then get their name from the userid. This also helps in the case where the user changed their name.
Ofcourse he would, unless he makes an indexmap. Besides he shouldn’t be storing the data of these users in the weekly players table. Not that he can’t but likely since he’d have the userIDs and he should be storing these in a scope based on userid (as per the roblox standard) he should already be able to get all the stats he want on that player from his own datastore.
@Arxk
I’m trying to get all the values in the table…? It gets the list of weekly players already. i’m just trying to do the same but without using “for i,v in” because then it’ll send a webhook every person that it does. thats a ratelimit problem lmao.
@T0ny I could try that, i’m assuming it works as a “for i,v in pairs() do v.UserId yadda yadda yadda”
also, just so all of you know, i don’t know how datastores work, or how any of this works tbh, as I am mostly a intermediate/beginner scripter.
Haha in this case v should just be a userid. Also you might end up hitting rate limits with my implementation so if you are presenting data especially in a webhook… I’d recommend saving that data in the weekly player table with the userid. In that case yeah it would be v.userId
When pushing it to where ever you are VIA webhook I’d recommend batching it with a cooldown. Basically process x amount of players every x seconds/minutes as to not hit that rate limit.
Yeah storing userIDS is much better lol, just incase of username change, i wasn’t sure if you already had that or not. I didn’t realize you had a web hook setup with all of this? What exactly does this webhook do?
Really? Its simple HTTP. I mean I was a web developer before I was a game dev so its second nature. (Though to keep from going off topic I’ll stop here)
I am trying to implement a Group Activity system because the group I am scripting this for is ( fairly inactive ).
This is the only way I thought I could implement it. By having the script check weekly all the players that have been in the game the past week. It’ll send those players in a webhook to a chat, then we’ll check them. fairly basic you’d think. seems fairly annoying to script for me lmao.
I also know how to use HTTP Requests, php and stuff but I wasn’t sure if I should use it, didn’t know how i’d implement a login system or anything really.
Just do a web hook when a player joins the game (though exiting might be better because you can calculate how long a player has been in the game. Though I suspect people will just join the game and afk to pretend to be active to get around this.) in a secret channel. (We all know your using this for you know what). And then you can use that awesome search feature to figure out who’s been active or not.
Might be better to check for certain activities and then if they’re met then do a web hook otherwise don’t count it as activity to prevent that circumvention of it.