Getting a Player's Ban History | Roblox Scripting Tutorial

Поділитися
Вставка
  • Опубліковано 1 жов 2024

КОМЕНТАРІ • 12

  • @CodingCapybaraRoblox
    @CodingCapybaraRoblox  3 місяці тому +9

    Here is the script:
    local banhistoryPages = game.Players:GetBanHistoryAsync() -- PUT A USER ID IN HERE
    local historyTable = {}
    local monthNames = {
    ["01"] = "January",
    ["02"] = "February",
    ["03"] = "March",
    ["04"] = "April",
    ["05"] = "May",
    ["06"] = "June",
    ["07"] = "July",
    ["08"] = "August",
    ["09"] = "September",
    ["10"] = "October",
    ["11"] = "November",
    ["12"] = "December"
    }
    local function getTime(data)
    local year = string.sub(tostring(data.StartTime),1,4)
    local month = string.sub(tostring(data.StartTime),6,7)
    local day = string.sub(tostring(data.StartTime),9,10)
    local hour = string.sub(tostring(data.StartTime),12,13)
    local minute = string.sub(tostring(data.StartTime),15,16)
    local second = string.sub(tostring(data.StartTime),18,19)
    local msecond = string.sub(tostring(data.StartTime),21,23)

    if string.sub(day,1,1) == "0" then
    day = string.sub(day,2,2)
    end

    return string.format("%s %s, %s, %s:%s:%s.%s", monthNames[month], day, year, hour, minute, second, msecond)
    end
    while wait() do
    for rank, data in pairs(banhistoryPages:GetCurrentPage()) do
    local timeFormatted = getTime(data)
    print("Were they banned: "..tostring(data.Ban))

    print("The time when it happened: "..timeFormatted)
    if data.Duration == -1 then
    print("How long was it: Permanent / Indefinite")
    elseif data.Duration > 0 then
    print("How long was it: "..tostring(data.Duration).." seconds")
    end
    print("The reason that was displayed: "..tostring(data.DisplayReason))
    print("The reason why it happened: "..tostring(data.PrivateReason))
    print("What is the PlaceId: "..tostring(data.PlaceId))
    end
    if banhistoryPages.IsFinished then break end
    banhistoryPages:AdvanceToNextPageAsync()
    end

    • @ItsSpaceManPlays
      @ItsSpaceManPlays 2 місяці тому

      if you want u can make a pastebin for free and set the language to lua it makes it like 10 times easier to copy

  • @ProSureString
    @ProSureString 3 місяці тому +5

    step 1: do it :D

  • @typoskwatter
    @typoskwatter 3 місяці тому +4

    It's great that you acknowledge your misunderstandings and update the community in such short time!

  • @makeitxx
    @makeitxx 28 днів тому

    Where did u go… I just stumbled upon your channel and it’s very helpful and great tips

  • @AlexLaSnypeure
    @AlexLaSnypeure 3 місяці тому +3

    Is there a way to view every single account that has been banned without having to manually put the userId in the script?

    • @RealMalul
      @RealMalul 3 місяці тому +2

      im gussing you can store the ids in a datastore, and then get get the user ids from the datastore and check if they are banned

    • @AlexLaSnypeure
      @AlexLaSnypeure 3 місяці тому +2

      @@RealMalul Yeah that's what i imagined would be best, thanks!

  • @Anobot
    @Anobot 3 місяці тому

    Thanks for this useful tutorial! I heard that Roblox will have us access to ban histories in the Creator Hub.

  • @Yuilix
    @Yuilix 3 місяці тому

    can you please make a tutorial video for first person view body? like there's a lot of tutorials sure but all of them the camera clipping inside the wall sadly. i would really appreciate it if you do a tutorial for that

    • @ggfoxysss
      @ggfoxysss 2 місяці тому

      You have 2 ways of doing it
      1. Using one of thoose tutorials and add a custom collision to the plr
      2. Moving the player character a bit backwards locally when you are in first person (i think this one is efficient at all but idk)

  • @Wh0s_Bun
    @Wh0s_Bun 3 місяці тому +2

    FIRST 🗣️