Built In Functions - Roblox Scripting for Beginners #9

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

КОМЕНТАРІ • 526

  • @AlvinBlox
    @AlvinBlox  5 років тому +150

    Don't forget to use Star code ALVINBLOX when buying Robux or Roblox Premium to support my channel at no extra cost! Thanks!

  • @ore1628
    @ore1628 5 років тому +253

    10:31
    "And all these thicc children"

  • @RolePlayJay
    @RolePlayJay 5 років тому +208

    Alvin, everytime you upload a video, it helps me with at least one thing in Roblox studio. Although I am not the best scripter, I never would have been able to start learning lua and other code without you. The types of things that you make on Roblox inspire me to make my own games and keep trying, even when my script doesn’t work.
    Thanks for all of your help!

    • @AlvinBlox
      @AlvinBlox  5 років тому +29

      No worries!

    • @Issemoran
      @Issemoran 4 роки тому +1

      Omg

    • @u-bum
      @u-bum 4 роки тому +1

      hie jay from ryg :)

    • @hlflifeenjoyer6176
      @hlflifeenjoyer6176 4 роки тому +1

      Yeah I even write on my NoteBook to keep this Datas like Variables,Functions Etc

    • @pr0g4m3rgyt
      @pr0g4m3rgyt 2 роки тому

      @@hlflifeenjoyer6176 Same

  • @ealy3545
    @ealy3545 5 років тому +105

    Alvin: 11:42
    me: you murderer.

  • @Swan_Land
    @Swan_Land 4 роки тому +61

    "These are the children because they are inside of them"

  • @Danido6809
    @Danido6809 5 років тому +66

    I saw the background cycle, you should definitely do a tutorial on a day/night cycle

    • @camryn8980
      @camryn8980 4 роки тому +8

      yeah i stared at my screen for a good 20 seconds waiting for the moon to speed by at 10000 miles an hour but nothing happened so i was like ok

    • @jayfontanilla7026
      @jayfontanilla7026 4 роки тому +1

      moon animator

    • @amirmohammadalizadeh5040
      @amirmohammadalizadeh5040 4 роки тому +2

      Yea he must really learn it to us

    • @topgearmc8285
      @topgearmc8285 3 роки тому +7

      There is a Tutorial on UA-cam, but from Roblox itself.

    • @sparrow3394
      @sparrow3394 2 роки тому

      @@jayfontanilla7026 that’s not what moon animator is for…

  • @deli8878
    @deli8878 4 роки тому +339

    Wait(5)
    Earth.Life.HomoSapiens.MyMom:ClearAllChildren()
    Ok so guys I started the script and everything seems g

    • @cyanproduct
      @cyanproduct 4 роки тому +21

      Under rated comment lol

    • @hedgehog8485
      @hedgehog8485 4 роки тому +34

      local Find = Earth.Dead.Humans:FindFirstChild("Daler Karimov
      ")
      If find then
      find.Parent = Earth.Life
      end
      There you should be alive now Daler Karimov.

    • @nuclear_reactor5x5
      @nuclear_reactor5x5 4 роки тому +8

      No it’s Universe.Earth.House.Mom:ClearAllChildren()

    • @epicfilms4life507
      @epicfilms4life507 4 роки тому +9

      @@hedgehog8485 ah but you see you have defined the variable as "Find", but when you tried to call it you have spelt it as "find", meaning Daler is still dead. RIP Daler

    • @ChompDead
      @ChompDead 4 роки тому +2

      Yahya Ali instead, you couldve did this:
      local Find = Instance.new("Daler Karimov")
      Find.Parent = Earth.Life

  • @XMinosX
    @XMinosX 2 роки тому +7

    you're such an amazing teacher. I've actually been using your lessons to code because I joined a group of people recently who have a creature game they want to make but we don't have a programmer yet so I decided to try and learn, though I also do the art for the creatures. I'm super excited to keep learning from these videos and hopefully really be able to make a game with what I've learned from you.

    • @therealgungus160
      @therealgungus160 Рік тому

      update?

    • @haniboutlat3711
      @haniboutlat3711 Рік тому

      Hey there! Do you mind sharing some tips for building in Roblox? Sorry for bothering btw.

  • @miner1011
    @miner1011 4 роки тому +7

    you really help me man, i havent gone this far in scripting in my life to be honest

  • @aguy6142
    @aguy6142 4 роки тому +20

    nobody:
    absolutely nobody:
    people who decide to watch an AlvinBlox video after a year: WoW bRo YoUr VoIcE cHaNgEd!

    • @sortrec7718
      @sortrec7718 4 роки тому

      no one asked

    • @4w24_
      @4w24_ 4 роки тому +4

      @@sortrec7718 About you

    • @eloelz56
      @eloelz56 3 роки тому +1

      @@sortrec7718 lmao one whole year and mans not even gotten one person to agree with him

    • @qJusy
      @qJusy 2 роки тому

      @@eloelz56 2 now

  • @ryze36
    @ryze36 4 роки тому +4

    bro ur the best guy ever, i've always wanted to learn how to script but it seemed like its alot to learn and you need to wait alot so you can make a proper script but now im at your 9th lesson and this is surprisingly not boring as it is at school and its fun!

  • @Tommy-hl2ic
    @Tommy-hl2ic 5 років тому +3

    Thx for making the beginner scripted series Alvin! I knew most of the videos you did, but you made me understand them even better than any other youtuber can do! I enjoy watching your tutorials! Keep up the good work!

  • @Pharrell1
    @Pharrell1 5 років тому +40

    Make a tutorial on how to make end game results. (Like MVP and that)

  • @SnatchedOwl1289
    @SnatchedOwl1289 5 років тому +12

    how the hell is this man making scripting fun, just how, like its so fun man

    • @arthurhero2794
      @arthurhero2794 2 роки тому

      so true Alvin is like always so kind and is like taking free tuition. like almost 99.99% of the people here who concentrates on everything he says are to learn scripting for sure.

  • @SnatchedOwl1289
    @SnatchedOwl1289 5 років тому +7

    thank you so much, i really like how you explain scripting in the most simple way possible, i love ur vids

  • @MachiavelIi
    @MachiavelIi 4 роки тому +7

    R.I.P
    Part
    00:00 - 5:15
    “I just want to be in a game...”

  • @ondras2219
    @ondras2219 5 років тому +17

    Hi Alvin, i am founding like 1 year of script where "If player is in some bath "aka i think some Part" then he got let say points 2 times added to stats" if u know in Super Power Training simulator i mean something like (city port) or tornado if u know game u know what i mean so if u can, please make video or message me back thanks you, Ps: i looked anywhere [Like so he see please]

  • @merma9503
    @merma9503 5 років тому +80

    *"hopefully, it will get destroyed."*

  • @smoregaming9845
    @smoregaming9845 3 роки тому +4

    If you need help with parent and child look in the properties of the thing you want to find the parent for and it should be there but thanks for all you've done Alvin your a real one :)

  • @mreggnoggin
    @mreggnoggin 5 років тому +17

    Wow. I Haven’t watch you in 2 years, and I time did it’s thing to your voice

  • @caspasaur
    @caspasaur 4 роки тому +20

    Reminder that:
    local myClone = game.Workspace.Part:Clone()
    myClone.Parent = game.Workspace
    and
    game.Workspace.Part:Clone().Parent = game.Workspace
    both create the same duplicate part. It just gets rid of the variable created with "local myClone". Which means if you want to create 5 parts of the same block, the script would look like this:
    local myClone = game.Workspace.Part:Clone()
    myClone.Parent = game.Workspace
    myClone.Parent = game.Workspace
    myClone.Parent = game.Workspace
    myClone.Parent = game.Workspace
    myClone.Parent = game.Workspace
    or
    game.Workspace.Part:Clone().Parent = game.Workspace
    game.Workspace.Part:Clone().Parent = game.Workspace
    game.Workspace.Part:Clone().Parent = game.Workspace
    game.Workspace.Part:Clone().Parent = game.Workspace
    game.Workspace.Part:Clone().Parent = game.Workspace
    They both do the same, but with the variable the code just becomes a lot more structured.

    • @Andrew-nl4jf
      @Andrew-nl4jf 2 роки тому +4

      i = 0
      while i < 5 then
      game.Workspace.Part:Clone().Parent = game.Workspace
      i =+ 1
      end
      less verbose way to do it

    • @izih
      @izih Рік тому

      @@Andrew-nl4jf what does i translates to

    • @izih
      @izih Рік тому

      @@Andrew-nl4jf I apologize for my condolences but it seems that the code is actually
      i = 0
      while i < 5 do
      game.Workspace.Part:Clone().Parent = game.Workspace
      i += 1
      end
      If I am wrong, I am sorry again

    • @somedude8728
      @somedude8728 Рік тому

      @@izih yeah you wrote it right btw

  • @domtu7129
    @domtu7129 2 роки тому +1

    quick overview
    Built in Functions are Roblox's premade functions and there are 2 types of built in functions: Member functions and Global functions.
    AlvinBlox mentioned 5 basic Built in functions that are useful.
    Member functions are functions that affect an object, while Global functions affect the script.
    To use a Member function you need to define what part you want and then type a ( : ), then the function you want to use.
    Example: game.Workspace.part:Destroy()
    To use a Global function you type it in in what spot of the script you want it to be in, global functions appear blue.
    Example: wait(5)

  • @ultimatesheep
    @ultimatesheep 3 роки тому +4

    coding in a nutshell:
    Parent:findfirstchild("Brat")
    Brat:Destroy()

  • @cupman9821
    @cupman9821 5 років тому +3

    ClearAllChildren() will clear all the Objects inside it like "workspace:ClearAllChildren()" it will remove parts mesh part wedge ands any kinds of part will be removed from workspace even a player model will be removed too and it cannot remove the "Camera" , "Terrain" from the workspace.

  • @MattBlox360
    @MattBlox360 4 роки тому +3

    I would never have been able to learn Lua code and other code without you and your amazing videos. because of this I also keep trying and never give up even if my script doesn't
    't work

  • @angrycommentman6601
    @angrycommentman6601 4 роки тому +47

    Murderer: destroy the child
    Scripter: ok. :ClearAllChildren()
    Murderer: ok how did you say brackets

    • @sammleczko
      @sammleczko 4 роки тому

      @@thunderr3869 r/whoosh

    • @noobsunited5059
      @noobsunited5059 4 роки тому

      @@skymbuc9049 r/Igotreddit

    • @DesiredLucas
      @DesiredLucas 4 роки тому

      @@noobsunited5059 r/noboyasked

    • @foffrz
      @foffrz 4 роки тому

      @@skymbuc9049 r/WhoooshHas3Os

  • @dragon1x158
    @dragon1x158 4 роки тому +1

    Hey Alvin can you halps me I am trying to make a script that will respawn a part that I have created with a function every 5 seconds. It will delete it then respawn it in the same position again. I cant find what i am doing wrong. Here is the script:
    function RespawnPart()
    local part = Instance.new("Part")
    part.Anchored = false
    part.Color = Color3.new(0.384314, 0.219608, 0.109804)
    part.CanCollide = true
    part.Material = Enum.Material.Wood
    part.Position = Vector3.new(-1, 0.5, 6)
    part.Name = "Car1"
    part.Parent = workspace
    end
    local x = 25
    repeat
    RespawnPart()
    wait(5)
    game.Workspace.Car1:Destroy()
    until x == 30

  • @YouGamer50501619
    @YouGamer50501619 5 років тому +14

    I remember that soft voice you had near the beginning of your youtube channel awwww. Lol

  • @penguinphd3019
    @penguinphd3019 3 роки тому +1

    Wow, AlvinBlox I know how to code in python and this series was VERY easy to pick up! Every time I watched one of your videos it made me want to try something on my own to see if it works and it was just a feeling I didn't get while I learned python. Thanks so much for making these vids I LOVE THEM!!!!

    • @citedwriter885
      @citedwriter885 2 роки тому

      same bro

    • @citedwriter885
      @citedwriter885 2 роки тому

      when i saw the first episode of this series, when he was printing a number i thought he was gonna type
      print(str(5048))

  • @tb-yy6yf
    @tb-yy6yf 5 років тому +3

    Hey, I love your vids so much. By the way, do you have plans for doing a tutorial for GUIs?

    • @penguinphd3019
      @penguinphd3019 3 роки тому

      You should watch TheDevKing's GUI Tutorial series it is very helpful!

  • @mateuszjasnos5786
    @mateuszjasnos5786 2 роки тому

    bro i have two words to say: thank you! like you're making good toturials and make scripting fun and easy

  • @rslashwoooshifgay9801
    @rslashwoooshifgay9801 5 років тому

    Wow! I’m back from 2 years, and your voice is so different! This video also helped me a lot, thank you,

  • @octojuice7278
    @octojuice7278 4 роки тому

    alvinblox tutorials are literally the only scripting tutorials i can understand. thank you alvinblox

  • @revasredcanary8020
    @revasredcanary8020 4 роки тому +3

    "has no more children, they've all been destroyed"

  • @208Roblox
    @208Roblox Рік тому

    you make very good tutorials i didnt thought i was gonna ever learn LUA

  • @notsorookie2752
    @notsorookie2752 4 роки тому +2

    Thank you for the clone one, Now I know how to reset Maps!

  • @ProdByALFTH
    @ProdByALFTH 4 роки тому

    bruh without you i wouldnt know what im doing on studio and id make trash games with no scripting and hardly any effort tysm and keep up the good work mate ur doing well

  • @mianreplicate
    @mianreplicate 5 років тому +1

    Interesting, I managed to teach myself scripting but if it wasn’t for you I wouldn’t have been able to get started :)

  • @joesutt7432
    @joesutt7432 5 років тому +6

    Hi Mr. Blox of Alvin. I was looking at other UA-cam videos about how to set a safe zone and coding for 2 hours and none of them worked so can you make one since you are the best youtuber I know
    Thank you for you service
    To Mr.Blox of Alvin

  • @braydensimpson7201
    @braydensimpson7201 2 роки тому

    My guy Alvin Is such a big help, Coding is fun!

  • @thecosmicminer5589
    @thecosmicminer5589 5 років тому

    Finally new alvin blox vid, your
    Tutorials are the best

  • @dedley2664
    @dedley2664 4 роки тому +3

    Press F to pay respect for the children of that part. They were a happy family but were murdered by the swift judgment of the script.

    • @matthrew
      @matthrew 3 роки тому +1

      Wait (2)
      Print ("F")

  • @petarkil
    @petarkil 4 роки тому

    10:30 indented means on your key board is pressed tab, you can see those used in functions, basically defining is something in something or is it not.
    function idk()
    print("something") (youtube neither alot of platforms for searching etc dont support indention or tab character)

  • @fabiiic-ops8600
    @fabiiic-ops8600 4 роки тому

    Before I watch the Video I press Like because I know it will be GOOOOD! Thanks Buddy

  • @TheScorched
    @TheScorched 4 роки тому

    Dude, I am obviously gonna use your star code when buying robux, you are saving me money, I have learned alot from this

  • @joshbongalos213
    @joshbongalos213 4 роки тому +1

    I'm starting to forget everything you said from the beginning so had to rewatch again

  • @TheRealOderless635gnat
    @TheRealOderless635gnat 4 роки тому +1

    if youre wondering how to make it wait in python use this type in import time at the top line and then use time.sleep() and put the seconds u like
    make sure that its correct as well

  • @londonooga3350
    @londonooga3350 2 роки тому

    DUDE THIS IS HELPING OUT SOOOOOOOOOOOOOOOOOOO MUCH IM SUBING

  • @User0009qqqqq
    @User0009qqqqq 2 роки тому

    Great explanation! Your videos are really helpful! 👍

  • @andreibotofan6988
    @andreibotofan6988 5 років тому

    Epic video as always. tThanks for the lesson :D

  • @italie7615
    @italie7615 4 роки тому

    I am starting to learn lua and your videos are helpful

  • @HyperLeopard
    @HyperLeopard 4 роки тому

    All the tutorials I have been putting wait in some parts and I made it work 🙂

  • @cookiedev8527
    @cookiedev8527 4 роки тому

    I needed this for the game I am working on. Wowwww nice!

  • @glennochieng7576
    @glennochieng7576 4 роки тому

    thank you Alvin for your vids they are really helpful and you explaining it well

  • @Devil_edits_op
    @Devil_edits_op 2 роки тому

    alvin your the best now i can start coding i didt anything like anything you helped me a lot bro

  • @maxplayz2631
    @maxplayz2631 3 роки тому +1

    In captions, sometimes when he is saying wait, it says he is saying weight

  • @ecarteo
    @ecarteo 4 роки тому

    If someone's watching this in august 2020
    Just want to remember that you can also use warn() like a print() they are similar and they work the same, They just change the color of the print

  • @jennm3170
    @jennm3170 5 років тому +1

    Can you make a video on a christmas prize calendar??

  • @blackpenguin1695
    @blackpenguin1695 Рік тому

    ppl: "inteligence"
    alvin blox: "inetlisence"
    me: "intelectual"
    smart ppl: "AI"
    community:"a very smart person"

  • @Fabianthaguy
    @Fabianthaguy 3 роки тому +1

    I've seen this video like 5 times for reference but everytime he says "They are Children." at 10:20 it always catches me off guard

  • @SwiftlySev
    @SwiftlySev 4 роки тому +1

    Roblox studio do be Joseph Joestar guessing your next line of code

  • @subtomymaindealthereal1136
    @subtomymaindealthereal1136 4 роки тому

    Thank you a lot I feel like you are getting me somewhere on my journey to make a game

  • @guywithahoodie7859
    @guywithahoodie7859 4 роки тому

    You do really teach me, You taught me/Are teaching me better than those creator challenge things

  • @arenzion6952
    @arenzion6952 4 роки тому +9

    Once he guessed how I was wondering about print being useful, I knew, he was the chosen one.

  • @ultimatetroll_yt
    @ultimatetroll_yt 2 роки тому +1

    You're really helpful, clear and easy to understand and follow! Thank you for these amazing videos! :D

  • @emmanueledits
    @emmanueledits 5 років тому +1

    Hey Alvin Blox!I have been trying to do the tutorial sword game but it wont work for some reason! can you help me?

  • @MatteoP04ita
    @MatteoP04ita 5 років тому

    Awesome as always

  • @In_soi
    @In_soi 4 роки тому +1

    I just learned today how to make a lag game with this

  • @sorexna
    @sorexna 3 роки тому +1

    the returning tutorial was more confusing than this one, this tutorial is actually easy.

  • @vexbolt8031
    @vexbolt8031 5 років тому +1

    Ur pc fast, what’s kind u have?

  • @pixelgang2967
    @pixelgang2967 5 років тому +1

    Hey Alvin can you make a video were when you level up in the game you can unlock stuff and buy stuff with an in game currency?

  • @gentleman2157
    @gentleman2157 4 роки тому

    Alvin: 11:42
    Alvin = The man behind the slaughter

  • @jjeffy10
    @jjeffy10 3 роки тому

    TY ALVIN BLOX I LEARNED A LOT FROM YOU

  • @aperson2699
    @aperson2699 4 роки тому +1

    11:53 If you wrote game.workspace:ClearAllChildren() would it get rid of everything in the workspace?

    • @JLChaos
      @JLChaos 4 роки тому

      yes
      that would make a great virus for people who make viruses lol.

  • @SamariumHelium
    @SamariumHelium 3 роки тому

    Amazing, even just as a refresher. Have you got/can you make something on data storage?

  • @bhumiraksmith4656
    @bhumiraksmith4656 4 роки тому

    I liked your video, but I don't understand why you have to put the clone part into a variable other than making it easier to type in the future. This is because you can code in (game.Workspace.Part:Clone().Parent = workspace) and it work just like it intended. Good practices perhaps to write it in variables?

  • @pep152
    @pep152 2 роки тому +1

    if i do something like
    lcoal part = game.workspace.part:clone
    part.parent = workspace
    part:clear all children
    how would i make it clear the children of both parts?

  • @Redcodes
    @Redcodes 5 років тому +2

    Can you do a Tutorial Video for HttpService?

    • @AlvinBlox
      @AlvinBlox  5 років тому +2

      Maybe if I have time

  • @sve2223
    @sve2223 5 років тому +1

    Alvin, i made a map/game but when i try to play it ,it only shows baseplate. And then i open to roblox studio and my creation are still there...

  • @wis-
    @wis- 4 роки тому

    Alvin belike: "so you do game.Workspace.part:destroy()"
    Part belike: "Please dont destroy me"

  • @ky-anhnguyen1622
    @ky-anhnguyen1622 4 роки тому +1

    Very Helpful, I tried it myself and wondered if we are able to clone the parts that has functions added within them? cause at the moment, it looks like I can only clone the end result of what the part will become once the function has ended instead of the beginning of when the function has started

    • @rntflower419
      @rntflower419 2 роки тому

      now u know? cause i want to know if u can do this

  • @commandblockgal7396
    @commandblockgal7396 5 років тому

    I miss your old voice, _they grow so fast_

  • @yellopz
    @yellopz Рік тому

    This is where it gets fun.

  • @SkullsDev
    @SkullsDev 2 роки тому

    Destroyed can be great for map voting because once the map is voted on you can close the old map and open the new map uses a instance.new

  • @techhie9900
    @techhie9900 5 років тому

    I still wish I was a member but keep up the good work Alvin!

  • @snoman2017
    @snoman2017 3 роки тому +1

    My favourite scripting tutorial, learning how to delete children

  • @arshinv7848
    @arshinv7848 4 роки тому

    why do we need the parentheses in the built in functions?? like for clearallchildren and clone? alvin pls tell me because i saw scripts where people put something in the parentheses of Clearallchildren.

  • @EliezPaulino
    @EliezPaulino 5 років тому

    My gosh. Your voice. You’ve grown.

  • @coolkid7377
    @coolkid7377 4 роки тому +1

    Anyone confused of Parented by and children thing of it like this. When you have a book, theres a "Table of contents" in it. The "Table of contents" is parented by the book while being the children of the book since it's in it. Anyone expert scripter out there that can tell me if this is a good comparison? Got it from a roblox lua book.

  • @ClockWiseIsAGreatDeveloper
    @ClockWiseIsAGreatDeveloper 4 роки тому +1

    guys just so you know these scripting tutorials still work in 2020

  • @ayesp6188
    @ayesp6188 5 років тому +1

    Alvin can you please make a metatable tutorial sometime for us slightly more advanced scripters!?

  • @warudikointothediko
    @warudikointothediko 5 років тому

    Thank u Alvin!

  • @Trininja11_LEGO
    @Trininja11_LEGO Рік тому

    "The part has no children, they've been destroyed" -AlvinBlox 11:42

  • @Issemoran
    @Issemoran 4 роки тому +1

    Thank you

  • @imHiruka
    @imHiruka 5 років тому

    Hey AlvinBloxx, I think I have an idea for a new tutorial.
    Ever thought of making skateboards? Like scripting an animation for them, making them work, doing the collisions?

  • @coneskid2
    @coneskid2 5 років тому +1

    hey Alvin, do you know a script to make your arm stay down when you’re holding items?

    • @ricardot3763
      @ricardot3763 4 роки тому

      create a function with humanoid properties

  • @dboi9414
    @dboi9414 5 років тому +1

    A bit inaccurate on the ":Clone" part of the video You can in fact use game.Workspace.Part:Clone().Parent = game.Workspace

  • @shades378
    @shades378 4 роки тому +1

    8:26
    "Its cloned, alright."

  • @Puwgen
    @Puwgen 3 роки тому

    Alvin. Easier way with destroy is "game.Workspace.Part:Destroy()"

  • @kokinyt8089
    @kokinyt8089 5 років тому

    Eventually can you make a video about all of the events? (I know that seems like a lot, no worries if you cannot.)