How To Make A Roblox Game | Learn Roblox Studio

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

Комментарии • 42

  • @bluebaeryboi
    @bluebaeryboi  7 дней назад

    leaderboard code:
    local DataStoreService = game:GetService("DataStoreService")
    local dataStore = DataStoreService:GetOrderedDataStore("LBStore")
    local Players = game:GetService("Players")
    local function GetPlayerData(player)
    local success, currentValue = pcall(function()
    return dataStore:GetAsync(player.UserId) or 0
    end)
    return currentValue
    end
    local function UpdatePlayerData(player, value)
    local success, err = pcall(function()
    dataStore:SetAsync(player.UserId, value)
    end)
    end
    local function IncrementAllPlayers()
    for _, player in ipairs(Players:GetPlayers()) do
    local currentValue = GetPlayerData(player)
    UpdatePlayerData(player, currentValue+1)
    end
    end
    local function UpdateLeaderboard()
    local success, errorMsg = pcall(function()
    local data = dataStore:GetSortedAsync(false, 10)
    local page = data:GetCurrentPage()
    for rankinLB, dataStored in pairs(page) do
    local name = game.Players:GetNameFromUserIdAsync(tonumber(dataStored.key))
    local template = script.Parent.Frame:Clone()
    template.TextLabel.Text = "#"..rankinLB.." "..name.." "..tostring(dataStored.value)
    template.Parent = script.Parent.TextBox
    end
    end)
    end
    --player join handling
    Players.PlayerAdded:Connect(function(player)
    local currentValue = GetPlayerData(player)
    if currentValue == 0 then
    UpdatePlayerData(player, 0)
    end
    end)
    spawn(function()
    while true do
    IncrementAllPlayers()
    UpdateLeaderboard()
    wait(60)
    end
    end)

  • @Real_Pump2
    @Real_Pump2 17 дней назад +2

    Your real good at game development.

  • @muhammadnasreddeen5694
    @muhammadnasreddeen5694 18 дней назад +2

    Wow great video, new sub!

  • @Player2GoRandom
    @Player2GoRandom 18 дней назад +1

    Great video! Nicely short, but still with all you need to know to start! Keep creating these🔥

  • @g-malek785
    @g-malek785 17 дней назад +1

    thank you very much this really helped me and helped everyone keep going❤❤❤

  • @EMMR0228
    @EMMR0228 14 дней назад

    How does this dude only have 250 subs?? Great editing for a new youtuber :)

    • @bluebaeryboi
      @bluebaeryboi  14 дней назад

      Ah thank you!! Working hard to improve 😅

  • @ClubbinWasTaken
    @ClubbinWasTaken 18 дней назад +2

    I originally thought you had 1k+ subs by how high quality this it!

    • @bluebaeryboi
      @bluebaeryboi  18 дней назад +1

      Thank you!! Trying my best to make good vids

  • @SonicSoulMusic.
    @SonicSoulMusic. 19 дней назад +1

    Great video as always 🔥🔥

  • @BlackPawDev
    @BlackPawDev 20 дней назад +1

    Great video!

  • @muhammadnasreddeen5694
    @muhammadnasreddeen5694 18 дней назад +1

    You should make like a longer tutorial in more depth and explaining stuff more. Also you should make a tutorial on how to code!

    • @bluebaeryboi
      @bluebaeryboi  17 дней назад +1

      Good ideas! Yeah a deep dive and a coding one will be nice

  • @Tv_3Z
    @Tv_3Z 19 дней назад +1

    underrated

  • @SharpClawsDev
    @SharpClawsDev 20 дней назад +1

    Cool stuff

  • @นฤมลขันกะโทก
    @นฤมลขันกะโทก 11 дней назад +1

  • @voidliqe
    @voidliqe 18 дней назад +2

    where's the part how you promote it 🥺

  • @bluebaeryboi
    @bluebaeryboi  20 дней назад

    function onTouched(obj)
    local h = obj.Parent:FindFirstChild("Humanoid")
    if h then
    h.Health = 0
    end
    end
    game.Workspace.Baseplate.Touched:Connect(onTouched)

    • @rotchetcomora288
      @rotchetcomora288 17 дней назад +1

      Can you do Ike
      Local idk = script.Parent
      Idk.Touched:Connect(function(touch)
      If touch.Parent:FindFirstChild("Humanoid")
      Touch.Parent.Humanoid.Health = 0
      end)

    • @bluebaeryboi
      @bluebaeryboi  17 дней назад +1

      @@rotchetcomora288 Yes! When you write the script like this, the script must go into the actual part, but as long as it is, it will work the same!

  • @wolfboy19585
    @wolfboy19585 8 дней назад +1

    THIS IS THE HARDEST CODE EVER BRO I CANT FIND PINNED COMMENTS UP DOWN NOWARE

    • @bluebaeryboi
      @bluebaeryboi  7 дней назад

      local DataStoreService = game:GetService("DataStoreService")
      local dataStore = DataStoreService:GetOrderedDataStore("LBStore")
      local Players = game:GetService("Players")
      local function GetPlayerData(player)
      local success, currentValue = pcall(function()
      return dataStore:GetAsync(player.UserId) or 0
      end)
      return currentValue
      end
      local function UpdatePlayerData(player, value)
      local success, err = pcall(function()
      dataStore:SetAsync(player.UserId, value)
      end)
      end
      local function IncrementAllPlayers()
      for _, player in ipairs(Players:GetPlayers()) do
      local currentValue = GetPlayerData(player)
      UpdatePlayerData(player, currentValue+1)
      end
      end
      local function UpdateLeaderboard()
      local success, errorMsg = pcall(function()
      local data = dataStore:GetSortedAsync(false, 10)
      local page = data:GetCurrentPage()
      for rankinLB, dataStored in pairs(page) do
      local name = game.Players:GetNameFromUserIdAsync(tonumber(dataStored.key))
      local template = script.Parent.Frame:Clone()
      template.TextLabel.Text = "#"..rankinLB.." "..name.." "..tostring(dataStored.value)
      template.Parent = script.Parent.TextBox
      end
      end)
      end
      --player join handling
      Players.PlayerAdded:Connect(function(player)
      local currentValue = GetPlayerData(player)
      if currentValue == 0 then
      UpdatePlayerData(player, 0)
      end
      end)
      spawn(function()
      while true do
      IncrementAllPlayers()
      UpdateLeaderboard()
      wait(60)
      end
      end)

  • @wolfboy19585
    @wolfboy19585 8 дней назад

    Where

  • @rotchetcomora288
    @rotchetcomora288 17 дней назад +2

    The team is the problem here

    • @bluebaeryboi
      @bluebaeryboi  17 дней назад

      What's the problem? I don't quite understand :)

  • @wolfboy19585
    @wolfboy19585 8 дней назад

    WHERE

  • @neszi_nxx
    @neszi_nxx 6 дней назад

    Things I'd like to say:
    The Command + D thing is on Macbook only I'm pretty sure, if you're on windows then use Ctrl + C, it copies the part/script or object you're working on
    Ctrl + V pastes it, so ctrl + c you copy it, ctrl + v you paste it, if you want to paste it into something then select the object you're gonna wanna paste in into, and do Ctrl + Shift + V.
    I don't know how to code much but I've started learning from using chat GPT, It gives me scripts and tells me what it does so let's say like:
    local script.Parent = sp -- What this means is the parent of the script = sp, let's say you put this script inside a part, script.Parent is the part because it's the script's parent, and sp is something you can use instead of script.parent, so if you put this into a part (script) you can get it to change colours( correct if something is wrong in the script):
    this script changes the color of script.Parent and includes setting sp as a shorthand for script.Parent. This script assumes script.Parent is a part that can have its color changed.
    Code:
    Copy code if you wanna use it
    (MAKE SURE YOU PUT THIS INSIDE THE PART OTHERWISE IT WILL NOT WORK!!!, AND MAKE SURE IT'S A SCRIPT NOT A LOCALSCRIPT!!!!)
    local sp = script.Parent -- Shortcut for script.Parent
    while true do
    -- Generate a random color
    local randomColor = Color3.new(math.random(), math.random(), math.random())
    sp.Color = randomColor -- Apply the random color
    wait(1) -- Wait for 1 second
    end
    you can modify the time, or if you want it to apply certain colours instead then use this script:
    local sp = script.Parent -- Shortcut for script.Parent
    -- Define a table of colors
    local colors = {
    Color3.new(1, 0, 0), -- Red
    Color3.new(0, 1, 0), -- Green
    Color3.new(0, 0, 1) -- Blue
    }
    while true do
    -- Pick a random color from the table
    local randomColor = colors[math.random(1, #colors)]
    sp.Color = randomColor -- Apply the random color
    wait(1) -- Wait for 1 second
    end
    I can also give you more help in the replies, I will start making studio videos soon on how to make for example a shop, leaderstats and datastore system, leaderstats is for example a stat in the leaderboard, which counts for coins/kills and data store stores data, if you need any help pleeease reply to me I'm open to giving help
    edit: you will succed in making popular games if you keep on trying, get weapons/tools/scripts from the toolbox and look at how they're structured and made, from that you can learn how to make things, if you need assistance please ask me or chatgpt if you need to find models from the toolbox or tutorials

  • @wolfboy19585
    @wolfboy19585 8 дней назад

    WHERE