Start using Type Checking in Roblox! Roblox Development Tips

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

КОМЕНТАРІ • 52

  • @itsray5257
    @itsray5257 Рік тому +8

    So underrated, You show really useful things that other youtubers don't show. Thanks u a lot

  • @Whatyoi
    @Whatyoi 6 днів тому

    For those who don't understand type checking I suggest looking Lua types and learning that info but from my point of view the reason to use this it is going to be extremely useful when making games and your own modules for people to use it's a very good practice I think all scripters should start as well get used to it

  • @legendsiscool
    @legendsiscool Рік тому +2

    a while ago i saw this video and was like “why the hell would i ever need this? its just confusing” and now i have realized how extremely useful it is, thanks bro

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

      Hello a friend recommended me to watch this video, if possible can you teach me because I am in the position you was in before you said it was helpful thank you

    • @legendsiscool
      @legendsiscool Рік тому +1

      @@UnknowFactsP1 its simple really
      lets say you connect a remote event or something and send the server the position of your mouse, you can put your player in and then a variable for the mouse (lets just say mousevar) and you can do :Vector3 next to it (mousevar:Vector3) and then the variable acts as a vector3 and lets you do stuff like mousevar.Y or mousevar.Unit and stuff so you dont have to memorize all the stuff

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

      @@legendsiscool can you tell me what you use it for? and a more easier example

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

      @@UnknowFactsP1 k lets say you create a part in workspace when someone clicks a button and you want a script to find that part, u just use workspace:waitforchild(“partname”), if you want to add a .Touched event to it with auto fill you can say local partname:BasePart = workspace:waitforchild(“partname”)
      the script now thinks its a part and now instead of having to manually type out .Touched:Connect(function() it gives you the option to auto fill and if you put a variable for the touched part it wont show up as “a” and make you auto fill and will see it as a basepart like it normally would
      basically makes typing scripts easier and more convenient

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

    i learned a lot from this tutorial but i had to keep pausing to keep up with your fast pace lol please slow down more

  • @fredericlossignol3874
    @fredericlossignol3874 Рік тому +1

    So useful for clean coding in roblox !! 🙌 thanks a lot guy

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

    Solid Info. TY

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

    thanks a lot for this video much better than the other confusing ones :D

  • @black_1009
    @black_1009 2 роки тому +3

    Will you do a video about saving your data for the shop guide series

  • @iknosabuk
    @iknosabuk 9 місяців тому

    Are you able to give the annotations/types descriptions? As to further explain how it can be used and such, like the Roblox types.

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

    solid info, appreciated.

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

    Love the vids. They are so useful

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

    Just checking the definition of a singleton : "A singleton in Roblox's version of Lua refers to a class that only has one instance throughout the entire game. These are generally service classes provided by Roblox itself. For example, game, workspace, Players, UserInputService, TweenService, etc., are all singletons in Roblox."
    10:08 when OP is talking about singletons, he seems to be refering to constraining a variable to only accept certain values. Seems to be slightly different, but then again, I am not a programmer, so maybe I am missing something.

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

      Hey, I agree that singleton is an unusual name, but it is used in the official Luau docs: luau-lang.org/typecheck#singleton-types-aka-literal-types

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

    That would help alot

  • @RaenLua
    @RaenLua 11 місяців тому

    At 17:40 can't we assert the type?
    module.TestNumber = 10 :: number

  • @fayking
    @fayking Рік тому +1

    this actually helps me understand, you're the best

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

      Thanks, I'm glad I could help :D

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

    You don't need to enable strict script mode to enable type-checking.

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

      Oh my apologies, thanks for the correction. I believe you might have had to do this at one point, but maybe I’m misremembering.

    • @RoboGameOfficial
      @RoboGameOfficial 11 місяців тому

      @@MonzterDEV You need to enable it for errors to pop up in the output, but not for intellisense

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

    I wonder what it supposed to do when people do return type (value) or export type (value)..

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

      I wonder what the "Type" is for.?

    • @yarik_superpro
      @yarik_superpro 11 місяців тому

      whole video is about it.....type is like typeof but from lua also@@KageNoDragon

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

    can you update the simulator playlist with new videos?

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

      Simulator episodes release every Friday. Are you referring to one missing from the Playlist?

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

      oh, i didn't know that, thx for telling me

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

    When is the next pet system video coming out?

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

      Every Friday is a Simulator video!

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

      @@MonzterDEV it's friday when will the video come out

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

    for Singleton couldn't you just use tables?

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

      What do you mean?

    • @qxxrd
      @qxxrd Рік тому +1

      @@MonzterDEV 10:10, Literal types. If I'm not mistaken, couldn't you just use tables to index the possible results? like:
      local results = {"Declined", "Purchased", "Not enough money", "Full Inventory"}
      print(results[1]) -- The one would be the result that you got

    • @bubblas5536
      @bubblas5536 Рік тому +1

      ​@@qxxrd you would need a separate variable to store which one is being used if you need to use it in multiple locations. The table variable alone cannot say if the program is using "purchased" or "declined". You wouldn't be able to do something like this with just a single table variable:
      if result == "Declined" then

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

      @@bubblas5536 good point!

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

      ​@@bubblas5536
      if results[1 or 2 or 3 or 4] == "Declined" then

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

    11:33

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

    YIPPEEEEEEEEEEEEEEEEEEEEEEE

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

    3:54 hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm bic?

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

      Suspicious..

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

      Lol, you can see my button presses were slightly off to the left.

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

    boo lean

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

    Key "LoadProfileAsync" not found in table ProfileStore ..?