Roblox Tycoon Scripting Tutorial

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • This series of videos will show you how to make a tycoon on Roblox in 2024, we will be going through everything you need to script in order to make a basic tycoon. More videos coming soon.
    Part 2: • Roblox Tycoon Scriptin...
    Get the project file by becoming a Channel Member: www.youtube.co...
    Video for members on how to download project file: • How To Access Project ...
    Discord: / discord
    Twitter: / alvinblox
    Roblox: www.roblox.com...

КОМЕНТАРІ • 456

  • @AlvinBlox
    @AlvinBlox  8 місяців тому +73

    Thanks a lot to my Channel Members who have stuck with me since I have been away from making videos. They get every new episode released 24h before everyone else. Part 2: ua-cam.com/video/muULrxFFP4Y/v-deo.html

  • @maddkat420
    @maddkat420 8 місяців тому +30

    Thanks for continuing to consistently teach the community new/updated things. Iv been watching your videos for a few years. As time has passed you become better at coding and teaching. Keep up the good work!

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

    Since i am a programmer i figured the second part, even if you know he language the roblox functions are still something to learn. Well thanks for the tutorial.
    game.Players.PlayerRemoving:Connect(function(player)
    for _, plot in Plots:GetChildren() do
    if plot:GetAttribute("owner") == player.UserId then
    plot:SetAttribute("taken", nil)
    plot:SetAttribute("owner", nil)
    end
    end
    end)

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

    local plots = game.Workspace.Plots
    game.Players.PlayerAdded:Connect(function(plr)
    for _, v in plots:GetChildren() do
    if v:GetAttribute("Taken") == nil and v:GetAttribute("Owner") == nil then
    v:SetAttribute("Taken", true)
    v:SetAttribute("Owner", plr.UserId)
    print("Plot given to "..plr.Name)
    break
    elseif not v:GetAttribute("Taken") and not v:GetAttribute("Owner") then
    v:SetAttribute("Taken", true)
    v:SetAttribute("Owner", plr.UserId)
    print("Plot given to "..plr.Name)
    break
    end
    end
    end)
    game.Players.PlayerRemoving:Connect(function(plr)
    for _, v in plots:GetChildren() do
    if not v:GetAttribute("Owner") then continue end
    -- plot is owned if it continues down here.
    if v:GetAttribute("Owner") == plr.UserId then
    v:GetAttribute("Plot", nil)
    v:GetAttribute("Owner", nil)
    print("Plot removed successfully for "..plr.Name)
    end
    end
    end)

    • @m1rtille
      @m1rtille Місяць тому

      what does this do

    • @Ashtube73
      @Ashtube73 Місяць тому +1

      @@m1rtillethis is the script

    • @D16tof_playz
      @D16tof_playz Місяць тому

      ty bc his script didnt work but urs did tysm

    • @Niksje075
      @Niksje075 Місяць тому

      What the v in your code?😅

    • @Niksje075
      @Niksje075 Місяць тому

      I continue to have a erro when it comes to for _, plot in plots:GetChildren() do can someone tell me what i do wrong in that code line
      Here is my error:
      Serverscriptsevice.plot handleiding:25: expected ')' (to close '(' at line 23) got 'for'

  • @ElMachoTacoo
    @ElMachoTacoo 8 днів тому +1

    For the people having problems try moving the Plots folder directly under workspace tab rather than within another folder. Had problems for a while but that fixed it instantly for me

  • @EL-HAKEM
    @EL-HAKEM 7 місяців тому +6

    For me when I hit start none of the plots have the two attributes, any idea what’s happening?

  • @nacktack
    @nacktack 7 місяців тому +7

    Is there a way to make it so that u are able to pick which plot u want instead of it picking for you?

  • @valkryxdoesdesign
    @valkryxdoesdesign 8 місяців тому +28

    Hi Alvin, great to see you back!

  • @Tickerion
    @Tickerion 7 місяців тому +8

    How can I make it so that it puts you in a team when you claim your tycoon? Like each base has its own team

    • @lmbs.
      @lmbs. 3 місяці тому +1

      Lemme know if you find out

  • @majabilaszewska4892
    @majabilaszewska4892 5 місяців тому +6

    Alvin? What do I do if it doesn't say "taken" when I go to view the attributes?

    • @thatonetrashduo7622
      @thatonetrashduo7622 5 місяців тому +1

      This is the same for me. Does it still work?

    • @zoma1687
      @zoma1687 4 місяці тому

      @@thatonetrashduo7622 Just tried it, still works, make sure you look at all the plots in the folder

    • @HuskMyLove0
      @HuskMyLove0 25 днів тому

      Maybe You arent looking the correct plot properties

  • @papipe291
    @papipe291 7 місяців тому +6

    It Did Not Work For Me 😢
    Somehow

    • @kennedy0504
      @kennedy0504 5 місяців тому

      Smae😢

    • @RoblozOriginal
      @RoblozOriginal 5 місяців тому

      Thats because you have to shift to make it work.

  • @srandomt
    @srandomt 4 місяці тому +15

    This tutorial series saved my game and my will to make it! Thank you for making it!
    I tried following another tutorial, but nothing worked and the stuff that did left me confused on why they did. You actually explained everything and did it well! Looking forward to making my first game and making it how I imagined without having to use shortcuts and being confused all the time

  • @LameObbyOfficial
    @LameObbyOfficial 24 дні тому +1

    hey alvin, so when i check the attributes, nothing shows up

  • @govar-zk7gv
    @govar-zk7gv 4 місяці тому +7

    I did everything right (I think) and at the end for me there are no attributes? What do I do now

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

      Yeah same

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

      same problem lmk if u find out

    • @Hello_3124
      @Hello_3124 Місяць тому +1

      i also have that problem

    • @ANURVM
      @ANURVM Місяць тому

      @@govar-zk7gv erase the "

    • @Dummycatt
      @Dummycatt 3 дні тому

      @@ANURVM bro which one ' or "

  • @Genanx-2023
    @Genanx-2023 3 місяці тому +5

    I did everything Same but it was not showing any attributes

  • @Icypenguin931
    @Icypenguin931 7 місяців тому +6

    ik it might be a bit late but its not setting any attributes for some reason

  • @ZayMan-ie2qj
    @ZayMan-ie2qj 2 місяці тому +2

    How did you learn scripting

  • @SentimentVeryForReal
    @SentimentVeryForReal 2 місяці тому +1

    FLIP YOU ALVIN, I tried this and copied everything you wrote down and your code didn’t work at all. You wasted 30 minutes of my life. Flip you.

    • @Zrozimus
      @Zrozimus 10 днів тому

      same, its like that for all his videos. I copy the script exactly how he puts it and it still doesnt work

  • @Zane_Does_Stuff
    @Zane_Does_Stuff Місяць тому

    Mb but when I type in "player.UserId" it does not turn blue why? Am I doing something wrong?

  • @bambidabamster
    @bambidabamster 10 днів тому +1

    It says no attributes added yet

  • @theabalaburn1
    @theabalaburn1 4 місяці тому +1

    pls make a working tutorial

  • @Scatscreamingcat
    @Scatscreamingcat 6 місяців тому +3

    hey i have a problem and no matter what ive done i cant fix it when i press the test play it says "player is not a valid member of datamodel "game"........ can anyone help me with this ?

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

      Have you found a solution? I'm dealing with the same problem

  • @Malik-r4f
    @Malik-r4f 7 місяців тому +2

    Theres smth wrong with mine but i secured it through alot of stuff wich is weird

  • @techbot145
    @techbot145 4 місяці тому +1

    It wont say Taken on the Attrtibutes could someone help?

  • @kramerthompson2450
    @kramerthompson2450 2 місяці тому +1

    Great Turtorial can you make a Turtorial for coding in creative 2.0?

  • @Epic_Gamer101
    @Epic_Gamer101 7 місяців тому +2

    I can’t believe I wasted my time on this, it didn’t even work, it just gave me a bunch of errors with the script.

    • @ArchieWebb-t4m
      @ArchieWebb-t4m 5 місяців тому +1

      It worked for me just look at the errors and copy the exact code line for line.

    • @MichelleBoakye78
      @MichelleBoakye78 5 місяців тому

      Mabye rewatch the totorial

  • @MrclawsYT
    @MrclawsYT 5 місяців тому +2

    You can’t watch this video without pausing lol

  • @TWITCH_CALLISTER
    @TWITCH_CALLISTER 6 місяців тому +1

    Hey bro love your vids but in this vid I copied code but it's not working for some reason any chance you could reach out to me? Also you just gained a sub 😊

    • @TWITCH_CALLISTER
      @TWITCH_CALLISTER 6 місяців тому

      Never mind I fixed it 😅 but yet again THANKS SO MUCH

    • @athstudioz
      @athstudioz 6 місяців тому

      pls share it
      @@TWITCH_CALLISTER

  • @aidanyoutube35
    @aidanyoutube35 8 місяців тому +1

    I subbed and still can’t watch part 2

  • @Ms.rodrigo
    @Ms.rodrigo 5 днів тому

    game.Players.PlayerAdded:Connect(function(player)
    -- Listen for when the player's character spawns (either initially or after death)
    player.CharacterAdded:Connect(function(character)
    -- Get the player's saved stage from the leaderboard
    local stage = player.leaderstats.Stage.Value
    -- Find the corresponding checkpoint part for the player's stage
    local spawnLocation = workspace:FindFirstChild("Checkpoint" .. stage)
    -- If the checkpoint exists, move the player to its position
    if spawnLocation then
    -- Move the character to the checkpoint
    character:MoveTo(spawnLocation.Position)
    end
    end)
    end)

  • @Seth_Harris
    @Seth_Harris 8 місяців тому +1

    YOU SOUND SO WEIRD WHAT

  • @supercooper8054
    @supercooper8054 2 місяці тому +1

    where that scribble line on my keyboard

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

      AltGr and then search where this thing is

  • @QIBSY100
    @QIBSY100 7 місяців тому +2

    Hey great video, it’s been really helpful to make my new game but next time you make a video can you put the script in the comments or description so we can copy and paste to speed things up a little, just a little suggestion but keep up the great work👍

    • @Cesar_Balcazar
      @Cesar_Balcazar 7 місяців тому +2

      Its for learning, he obviously wont put it so u can copy n paste it :v

  • @mrmcsam
    @mrmcsam 7 місяців тому +1

    Please help give me the script copy pasted I think I did smtg wrong

  • @rodruxer4598
    @rodruxer4598 8 місяців тому +1

    didnt work at all

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

    I got the script But not all if yall Want local Plots = game.workspace.Plots
    -- Player Joins a game
    game.Player.PlayerAdded:Conect(function(Player)
    -- Get a plot
    for _, plot in Plots:GetChildren() do
    if plot:GetAttributen("Taken") then continue end
    -- plot is not Taken, so we want to take it
    plot:SetAttribute('Taken', true
    plot:SetAttribute('Owner', player.UserId)
    end
    end)
    game.Players.PlayerRemoving:Connect(function(player)
    for _, plot in Plots:GetChildren() do
    if not plot:GetAttribute('Owner') then continue end
    -- the plot is owned by a player
    if plot:GetAttribute('Ownner')
    end
    end)

  • @megaman14110
    @megaman14110 Місяць тому

    ths if itemClone:IsA('Model ') then
    itemCFrame = itemClone:GetPivot()
    elseif itemClone:IsA('BasePart') then
    itemCFrame = itemClone.CFrame
    end
    not work for me help pls

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

    local Plots = game.Workspace.Plots
    --Player joins a game
    game.Players.PlayerAdded:Connect(function(player)
    --get a plot
    for _, plot in Plots:GetChildren() do
    if plot:GetAttribute("taken") then continue end
    -- plot is not taken, so we want to take it
    plot:SetAttribute("Taken", true)
    plot:SetAttribute("owner", player.UserId)
    end
    end)
    game.Players.PlayerRemoving:Connect(function(player))
    for _, plot in Plots:GetChildren()do
    if not plot:GetAttribute("owner")then continue end
    -- the plot is owned by a player
    if plot:GetAttribute("owner") ~= player.UserId then continue end
    -- we have found the correct plot
    plot:SetAttribute("taken",nil)
    plot:SetAttribute("owner",nil)
    end
    end

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

    why cant i print ' plot has been given to/taken from (me) ! '?
    oh my bad bro i was running it not playing it

  • @Guy-117
    @Guy-117 3 місяці тому

    broooo, this NEVER WORKS, i script and build THE RIGHT WAY, and it NEVER WORKS!!!

  • @JadeStevens11
    @JadeStevens11 Місяць тому

    I’m making a Roblox game but it’s hard 😢. And I don’t know coding.

  • @theabalaburn1
    @theabalaburn1 4 місяці тому +1

    0/10

  • @NOTHUMANGAMES
    @NOTHUMANGAMES 4 місяці тому +28

    Help my attributes don't say owner or the id.

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

    I'm watching in June 2024, Can somebody give me suggestions on why this isn't working?

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

      Yes I know why, in the plot:SetAttribute ('taken , true') and plot:SetAttribue ('Owner' , player.UserId), they should be " not '. Hope this helps😊

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

      @@FutureMrAtomic thanks, thats such a small difference yet it fixed it

    • @Dummycatt
      @Dummycatt 3 дні тому

      ​@@FutureMrAtomicwhy it didnt work? Where do you even put that

    • @FutureMrAtomic
      @FutureMrAtomic 3 дні тому

      @@Dummycatt in the script, it's written there

  • @euprimoeu
    @euprimoeu 6 місяців тому +1

    it says person not valid member to game datamodel

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

    😅 I didn’t copy the script. I just wrote them on my keyboard lol

  • @MarkBlox807
    @MarkBlox807 6 місяців тому +1

    how do I type this double this straight ´´

    • @euprimoeu
      @euprimoeu 6 місяців тому

      "

    • @MarkBlox807
      @MarkBlox807 6 місяців тому

      @@euprimoeu how im on Mac

    • @euprimoeu
      @euprimoeu 6 місяців тому

      copy it you dummy😭😭@@MarkBlox807

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

    *phew!* thank god this is actually close to the studio update!! the other ones from like two years ago don't work as often.

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

    In my output, it says player is not a valid member of data model “ game” does anybody know how to fix this?
    Edit: also, it doesn’t say I own a plot when I check the properties

  • @AdamCostelloe-fq5wv
    @AdamCostelloe-fq5wv 2 місяці тому

    “ a valid member of Workspace “Workspace” “ I don’t understand

  • @Matie453
    @Matie453 7 місяців тому +8

    u just earned a new sub! :D

    • @Tvpco.
      @Tvpco. 3 місяці тому

      ur telling me u never watched him back in 2018?

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

      @@Tvpco. i do, why u 4 months late😭

    • @Tvpco.
      @Tvpco. 3 місяці тому

      @@Matie453 Because I unsubbed to all roblox devs and i didnt know he made more vids

  • @PNC_YT
    @PNC_YT 6 місяців тому +1

    Please can u make a updated version of a story tutorial?

  • @galyxia1
    @galyxia1 Місяць тому

    Help why when I try to test does it say rendering is paused for debugging

  • @PEXO345
    @PEXO345 10 днів тому

    Guys i need help it said “players is not a valid member of data model “game” what sould i do!

  • @IchigoKurosaki-yb4dq
    @IchigoKurosaki-yb4dq 4 місяці тому +3

    broo how to select 5 or 6 part Together in one go 1:50 like this

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

    @AlvinBlox Where do I put the attributes?

  • @murphyhill-hp9pj
    @murphyhill-hp9pj 4 місяці тому

    game.player.playerremoving:connect(function(player)

  • @Josip-Broz-Tito
    @Josip-Broz-Tito 7 місяців тому +2

    hey so uh, nothing comes up in the developer panel when I click test, does anyone know why?

    • @Roblox_Bacon80
      @Roblox_Bacon80 6 місяців тому

      You have to click play but it doesn’t work

    • @Josip-Broz-Tito
      @Josip-Broz-Tito 6 місяців тому

      @@Roblox_Bacon80I know that you have to click play

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

    Roblox AI is smarter than this guy 20 min wasted

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

    my code got angry at me because I "Put unexpected global plots" in

  • @Mika-the-catt
    @Mika-the-catt Місяць тому

    My cat sat on my keyboard while I’m trying to code 😂

  • @simi8473
    @simi8473 Місяць тому

    this was great but i thought that you were gonna hack me because ........ oh well

  • @disarmedtax8483
    @disarmedtax8483 Місяць тому

    how do u move the plot is it just a click and drag becaus ehtat isnt moving it for me?

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

    Can anyone put the script in the comments so I can copy and paste it?

  • @Jaiman1-z1l
    @Jaiman1-z1l 7 днів тому

    Why can’t I see the attributes for the plots?

  • @SBG_YM
    @SBG_YM 12 днів тому

    Why doess my studio look white and and i cant see my output

  • @Animalfacts942
    @Animalfacts942 Місяць тому

    chat gpt can find the mistakes in your code just copy your code and go to chat gpt and paste

  • @RandomDied20
    @RandomDied20 5 місяців тому +1

    Why did it not add the attributes for me?

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

    For some odd reason my avatar is invisible now-

  • @soboloismine
    @soboloismine 2 місяці тому +1

    can you send me the script

  • @GzamLG
    @GzamLG 3 дні тому

    I don't have any attributes

  • @kriptoVR
    @kriptoVR 8 місяців тому +1

    For me when I hit start none of the plots have the two attributes, any idea what’s happening?

    • @AlvinBlox
      @AlvinBlox  8 місяців тому +1

      Hard to say, look through the code and write print statements to see which lines execute

    • @kriptoVR
      @kriptoVR 8 місяців тому +1

      Thanks I figured it out

    • @heinzherbert7502
      @heinzherbert7502 8 місяців тому

      @@kriptoVR what was the probelm? I have it too

    • @catgod7042
      @catgod7042 8 місяців тому

      how did you fix it, it happened to me to

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

    THANKS its really useful to explain why did you write the line, I've learned so many usages here

  • @Mystery_on_therise
    @Mystery_on_therise 5 місяців тому

    i just love british ppl (the accent ofc)

  • @murphyhill-hp9pj
    @murphyhill-hp9pj 4 місяці тому

    plot:getattribute('taken', false)

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

    Open The Tab To The Script:
    local Plots = game.Workspace.Plots
    -- player joins a game
    game.Players.PlayerAdded:Connect(function(player)
    -- get a plot

    for _, plot in Plots:GetChildren() do
    if plot:GetAttribute("Taken") then continue end
    --plot is not taken
    plot:SetAttribute('Taken',true)
    plot:SetAttribute('Owner', player.UserId)

    print('Plot Has Been Gived To'..player.Name.'!')
    break
    end
    end)
    game.Players.PlayerRemoving:Connect(function(player)
    for _, plot in Plots:GetChildren() do
    if not plot:GetAttribute('Owner') then continue end
    --the plot is owned by a player
    if plot:GetAttribute('Owner') ~= player.UserId then continue end
    -- we have found correct plot

    plot:GetAttribute('Taken', nil)
    plot:GetAttribute('Owner', nil)

    print('Plot Has Been Removed From'..player.Name.'!')
    break
    end
    end)

  • @bucketer_the_robuxless_creator
    @bucketer_the_robuxless_creator Місяць тому

    thks so much i am making my first scripted game

  • @drizzyfizzle
    @drizzyfizzle 7 місяців тому +1

    You know refreshing with a tycoon game seems a great idea!

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

    My attributes don’t appear on the plot it gave me 😢

  • @Adot-s9m
    @Adot-s9m 11 днів тому

    my plots file doesn't show when I test it

  • @TheRealGamer460
    @TheRealGamer460 4 місяці тому

    bro it didnt work it gave me an error and i directly copied all of your code

  • @Monki-k6x
    @Monki-k6x 2 місяці тому

    The code is not working pls help i do not know what went wrong

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

    MY attribute is saying that nothing is written

  • @nisithrasmika
    @nisithrasmika Місяць тому

    can someone comment the script pls

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

    I did everything and it does not work bro im so done

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

    thank you so much british man

  • @YassirIsBack
    @YassirIsBack Місяць тому

    Bro thanks You're the best

  • @murphyhill-hp9pj
    @murphyhill-hp9pj 4 місяці тому

    plot:setattribute( 'taken', true

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

    for some reason, I dont have any attributes in any plot (despite copying the script)
    is there a way to fix it?

  • @Leozin.x
    @Leozin.x 5 місяців тому

    Do you might to take subtitle in your videos ? Brazillian subtitle pls 😅

  • @butterboi.G.I.F
    @butterboi.G.I.F Місяць тому

    I have a problem with line 17. I says “ServerScriptSetvice.PlotHandler:17: Expected ‘=‘ when parsing assignment, got ‘in’ “
    Can anyone help me on this

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

    The getchildren thing won't work with Nil for some reason. What is this issue?

  • @Batkid5617
    @Batkid5617 12 днів тому

    I cant do attributes

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

    I followed the whole script but I kept getting mistakes after I fixed the other, I am stuck on a line 9 please help!! (it says that player.UserID isn't a member of (myusername)!!!)

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

    I keep getting "ServerScriptService.PlotHandler:17: continue statement must be inside a loop " does anyone know how to fix?

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

    It says that I’ve spelt plot wrong on the code ‘plot:SetAttribute( ‘Taken’ , nil)’ wrong but I haven’t. My code therefore doesn’t work. How do I fix it?

  • @KEN-hi8zo
    @KEN-hi8zo 3 місяці тому

    its not woking for me ;-; idk how to fix it

  • @2day-f5e
    @2day-f5e 2 місяці тому

    erm how do you get into the output 🤓

  • @Saif-h9g
    @Saif-h9g 5 місяців тому

    Pls help me with the attributes

  • @Geko2011g
    @Geko2011g 6 місяців тому

    dosent give any attributes