How To Make A Roblox Game | Learn Roblox Studio

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024
  • Learn Roblox Studio in 2024 with this complete tutorial. Check the pinned comments for the code :)
    Two common errors you might run into while running datastores for the first time:
    1. You can’t use a datastore unless your game is published. Publish it now, it won’t be shown to others until you choose to
    2. “you don’t have API access”if you have this we’re going to fix it by making a Boolean value in ServerStorage. set it to true, and name it SaveinStudio
    #robloxgamedevelopment #robloxstudio #roblox

ความคิดเห็น •

  • @bluebaeryboi
    @bluebaeryboi  21 วันที่ผ่านมา

    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)

    • @wolfboy19585
      @wolfboy19585 20 วันที่ผ่านมา

      Now it apperars

  • @ClubbinWasTaken
    @ClubbinWasTaken หลายเดือนก่อน +2

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

    • @bluebaeryboi
      @bluebaeryboi  หลายเดือนก่อน +1

      Thank you!! Trying my best to make good vids

  • @Real_Pump2
    @Real_Pump2 หลายเดือนก่อน +2

    Your real good at game development.

  • @muhammadnasreddeen5694
    @muhammadnasreddeen5694 หลายเดือนก่อน +2

    Wow great video, new sub!

  • @Player2GoRandom
    @Player2GoRandom หลายเดือนก่อน +1

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

    • @bluebaeryboi
      @bluebaeryboi  หลายเดือนก่อน

      Thanks! Will do!😄

  • @EMMR0228
    @EMMR0228 28 วันที่ผ่านมา

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

    • @bluebaeryboi
      @bluebaeryboi  28 วันที่ผ่านมา

      Ah thank you!! Working hard to improve 😅

  • @g-malek785
    @g-malek785 หลายเดือนก่อน +1

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

    • @bluebaeryboi
      @bluebaeryboi  หลายเดือนก่อน

      I'm glad! 🙂

  • @SonicSoulMusic.
    @SonicSoulMusic. หลายเดือนก่อน +1

    Great video as always 🔥🔥

    • @bluebaeryboi
      @bluebaeryboi  หลายเดือนก่อน +1

      Thanks for the support :)

    • @SonicSoulMusic.
      @SonicSoulMusic. หลายเดือนก่อน

      @bluebaeryboi no problem!

  • @SharpClawsDev
    @SharpClawsDev หลายเดือนก่อน +2

    Cool stuff

  • @BlackPawDev
    @BlackPawDev หลายเดือนก่อน +1

    Great video!

  • @muhammadnasreddeen5694
    @muhammadnasreddeen5694 หลายเดือนก่อน +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  หลายเดือนก่อน +1

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

  • @Tv_3Z
    @Tv_3Z หลายเดือนก่อน +1

    underrated

  • @นฤมลขันกะโทก
    @นฤมลขันกะโทก 25 วันที่ผ่านมา +1

  • @voidliqe
    @voidliqe หลายเดือนก่อน +2

    where's the part how you promote it 🥺

    • @bluebaeryboi
      @bluebaeryboi  หลายเดือนก่อน +2

      Coming soon! 😌

  • @bluebaeryboi
    @bluebaeryboi  หลายเดือนก่อน

    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 หลายเดือนก่อน +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  หลายเดือนก่อน +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 22 วันที่ผ่านมา +1

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

    • @bluebaeryboi
      @bluebaeryboi  21 วันที่ผ่านมา

      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 22 วันที่ผ่านมา

    Where

  • @wolfboy19585
    @wolfboy19585 22 วันที่ผ่านมา

    WHERE

  • @rotchetcomora288
    @rotchetcomora288 หลายเดือนก่อน +2

    The team is the problem here

    • @bluebaeryboi
      @bluebaeryboi  หลายเดือนก่อน

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

  • @neszi_nxx
    @neszi_nxx 20 วันที่ผ่านมา

    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 22 วันที่ผ่านมา

    WHERE