Roblox ObjectValues Are Insanely Weird

Поділитися
Вставка
  • Опубліковано 20 вер 2024
  • get my full Roblox Studio course here:
    linktr.ee/Byte...
    insta (i NEED clout pls): / subnautica_man
    discord: / discord
    wondered how to make a main menu in roblox studio? or how to create a shop which has working GUI? ive made lots of 2024 roblox scripting tutorials about all the different bits of roblox to give you some up-to-date information about all of its properties and events.
    my goal is to simply give some insight on how to use the various features and instances roblox studio, and show you some fun stuff you can do with them. thanks for checking out this roblox scripting tutorial :)

КОМЕНТАРІ • 94

  • @byteblox100
    @byteblox100  9 місяців тому +5

    like my teaching style? give me your email so I can send you stuff
    byteblox.ck.page/c2af95d792

    • @Catlover我爱猫
      @Catlover我爱猫 9 місяців тому

      ok

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

      I have a question if I have a model and I have a parts in there how can I move them all to that Position

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

      @@CIA_Insights
      do something like:
      model.PrimaryPart.Position = vector3.new(0,0,0)
      Or:
      Model:MoveTo(0,0,0)

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

      @@CIA_Insightsafter 6 month did u find it out

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

      @@AnimeOfficalCW yes I did

  • @oriad7483
    @oriad7483 9 місяців тому +46

    values existed before custom attributes were added. They were added long after as a more practical solution, but instances that were just values stayed around to keep other games working.

    • @MinerGritz
      @MinerGritz 9 місяців тому +1

      so does that imply that this could soon be deprecated?
      hmm...

    • @oriad7483
      @oriad7483 9 місяців тому +2

      @@MinerGritz Maybe. But if custom attributes have been around this long, I think they'll just exist as an alternative. I doubt anyone would really miss it anyway

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

      ​@@oriad7483 Leaderstats would be completely broken

  • @MajesticUC
    @MajesticUC 9 місяців тому +18

    2:05. Task.wait() runs twice as fast as wait() meaning it has twice the accuracy and also meaning it can wait at a minimum of 0.015 seconds as apposed to wait() which can wait for a minimum of 0.03. wait() also returns a second value storing the time that it stopped yielding at, which will make the yield time even longer!
    wait() can sometimes cause delay when it resumes the thread (stops yielding) due to performance issues. Overall task.wait() is just far superior

    • @rogenus
      @rogenus 9 місяців тому +3

      Agreed. I've always used task.wait() since I discovered it

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

      Nah it's not
      I tested
      And task.wait slower

    • @berrysus4531
      @berrysus4531 9 місяців тому +6

      @@ExoticFoxy me when i spread false information:

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

      Woah, majestic dev?

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

      @@berrysus4531 why would you

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

    5:53 you can't do that because by Default the character's model is set to Archivable = false (which means it can't be cloned and etc.) you would have to aet it to true first

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

    i've been programming in studio for 5 years now and actually i always ignored those attributes, never thought that they can store values like that, never even tried them out lmao

  • @Fishion.
    @Fishion. 9 місяців тому +2

    Last time I checked, you had 1.1k subs and I told you you were growing so fast! Look at you now! Almost 4k subs. Well deserved with such good content.

    • @byteblox100
      @byteblox100  9 місяців тому +1

      it was all you bro

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

      @@byteblox100 You're the one that put in the work, aren't you?

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

      @@byteblox100 only 3 months and you're already at 18.5k, this is really insane, but don't get too cocky with it

  • @bioeless
    @bioeless 9 місяців тому +2

    For anybody wondering, the reason why the script works only when you use Instance:Destroy() and not when you delete it in the editor is because Instance:Destroy() doesn't actually delete the object, it sets it parent to nil; So the object still exits in game, just not under the workspace. When you delete an object in the editor, it is completely removed from the game's memory.

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

      :remove() or :Remove() sets it to nil not destroy

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

      @@a_username_lol It says in the documentation that :Destroy() sets the objects parent to nil; I've verified by checking the objects parent after using :Destroy() on it. If there's something I'm missing, please let me know.

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

      @@bioeless oh i didnt know i thought it just completely removed it well ok

  • @ramdom_player201
    @ramdom_player201 9 місяців тому +2

    Custom attributes are fairly new, and so I never got used to using them. I prefer the original value instances because they show up independantly in the explorer and are good for configuration settings. The only time I would really use Attributes might be for backend scripting of stuff where I wouldn't need to manually access them.

  • @JayJay-ki4mi
    @JayJay-ki4mi Місяць тому

    Attributes can't be used to hold objects. For example, if I want to allow the user to select which rig/npc/object to apply my dialogue system to this won't work with attributes. Whereas if using an ObjectValue RBS will allow the user to use their cursor to select which object to apply it to.

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

    Yes, I totally watch you on my MCDonalds 30 minute break.

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

    4:49 it's bc when the game first starts, it launches all the scripts, when u do it outside of the script it deletes it from the games memory. When u do it in the script, it's still in games memory and therefore u can still access it through scripts, since the value is still there when u start the game

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

    task.wait() runs on the minimum frame time of your computer, whilst wait() runs on a minimum of 1/30th of a second, meaning task.wait() can be any value over zero, as it runs on your computer render time, it means it can be 1/60th of a second (if you're playing at 60fps), 1/120th, 1/144th, etc. it all depends on the framerate, on the server, though, it runs at 60fps instead of 30, which makes it double as fast as wait()

  • @swordlegend3256
    @swordlegend3256 9 місяців тому +1

    2:08 wait() is kinda deprecated and slow task.wait() is better than wait() every way its more accurate more preformant ect

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

    the reason that destroying it in studio vs destroying it in a script is different is most likely bcuz it stores the value before it gets destroyed. the parts got loaded in before the script did

  • @会供価
    @会供価 9 місяців тому +1

    Bro is posting everyday 🔥

  • @isosta2373
    @isosta2373 9 місяців тому +1

    They need to add instance references to attributes so i can make a solid serialization api for content based systems

  • @jaszczurka5069
    @jaszczurka5069 9 місяців тому +1

    4:24 when destroying a part it's parent is set to nil and isn't garbage collected until scripts are doing something with it so basically it's still exist

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

      Debris fixes that right

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

      In Simple Term's, When you use :Destroy() It Does Set The Instance's Parent to a "GC Folder" and Lock's the Parent, It Also Disconnect's any Connection's to That Instance, and Etcetera.. Again This is Simple Term's and Ive just Woken up Midle of The Day so Yhea.. No Coffee Yet. (Dont Take my Answer as Truth But Just a Hint, I Dont Have My Coffee Yet and Such I'm Probally Just Saying Thing's as a Mad-Lad.)

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

      @@Nigma_863 you talk like queen from deltarune

    • @Nigma_863
      @Nigma_863 9 місяців тому +1

      ​@@SquooshyShark1000Thank's I Guess Lmao.. Hope you Have a Good Christmas Eve! :)

  • @Bingus4
    @Bingus4 9 місяців тому +1

    how exciting

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

    attributes are too complicated to modify in scripts efficiently + takes too long to make a new one
    values is a better choice

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

    TYSM! I COULD MAKE A SKIN SYSTEM THAT VALUES EACH SKIN AS THEIR OWN VALUES AND NOT JUST A GUI!

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

    i forgot attributes existed :D
    i will now never use values again

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

    I get it! ObjectValues learn what your object is before the game starts, if you delete it before the game starts, it doesnt know what ur talking about. But it learns what the object is when the game starts, so it is unphased by its deletion

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

      :Destroy() doesn't "delete", it parents the part to nil. So the part still exists, it's just not in the workspace anymore.

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

      ​@@pantommyhow to delete a part completely

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

    SICK 🔥

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

    4:43 I'm not sure, But my prediction is that the object value before loading the game copies all of its properties or the actual part and then just has it as a value, but if you delete in studio, the object value has nothing to copy, THATS MY PREDICTION

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

      I Think It's Value is Just a PATH To That Instance, but When You Remove the Instance that's the "End Point" It's Technicly Nil/Null, But ofcourse If you Put a Difrent Instance at that "End Point" It will Fix that Nil/Null'ed Path. (Dont Take My Answer as Truth as Ive Litterly Just Woken Up Midle of The Day and I Havent had Coffee Yet, So It's Just a Hint/Opinion and I'm Probally Saying Thing's Like a Mad-Lad.) :)

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

    7:23 im not entirely sure if that's true or not, using the setattribute function in the cmd line: part:Setattribute("attributePart", workspace:FindFirstChild("AnotherPart"))

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

      u cant add objects into attributes

  • @debbieng3510
    @debbieng3510 9 місяців тому +2

    Hi

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

    please do a video about meshparts next!

  • @ChristopherMarquez-wn1sm
    @ChristopherMarquez-wn1sm 3 місяці тому

    coudn't you achieve the same (cloning a part) by placing the part into ReplicatedStorage and cloning that?

  • @AisarRedux
    @AisarRedux 9 місяців тому +1

    use while true do task.wait() instead of while task.wait() end, theres a whole doc about this :P

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

      Could you send that doc? I’m confused why having “while true do task.wait()” and “while task.wait() do” are different, they are the exact same if I’m not mistaken. while “true” do does just hold a Boolean, and while, do is just a loop

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

      @@coe_x firstly, the only reason why putting a wait in the while loop parameter works is because wait() returns a number. If roblox decides to change that, your script will break. Secondly, you tend to want to use a wait at the end of a loop.

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

      @@MajesticUC roblox will not commit any changes which will break scripts, unless those changes are meant to fix exploits/bugs, which isnt the case here.
      i see the point of waiting at the end of the loop, but when dealing with such tiny waiting amounts it doesnt really matter

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

    Can you make a tutorial on how to make a role require a badge

    • @QUBIQUBED
      @QUBIQUBED 9 місяців тому +1

      Read up on badge documentation

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

    Any Instance can be stored

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

    Can ObjectValues hold things inside ServerScriptService and ServerStorage? Since clients cannot access anything inside them, You can create a part in ServerStorage and an object value linked to it. If you try to clone the value from a local script, would it work? Or will it index nil?

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

      Value will not sync as it does not exist on the client, so nil

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

    Can you datastore objectvalues?

  • @ocanslair
    @ocanslair 9 місяців тому +1

    woa

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

    interesting

  • @Catlover我爱猫
    @Catlover我爱猫 9 місяців тому

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

    2:11 its easier on the game

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

    can you crate attributes using scripts?

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

      :SetAttribute()

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

      @@byteblox100 i meant create

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

      ​@@rockyes3239thats actually how u do it

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

      That's what you do, if you set an attribute that doesn't exist, it creates it​@@rockyes3239

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

      @@rockyes3239 that's how you create them. SetAttribute takes two parameters; the name of the attribute and the value you want to set to that attribute, so something like SetAttribute("Cash", 100) will work.
      SetAttribute will create a new attribute if it cant find an existing attribute with the same name you gave it. So if we dont have a "Cash" attribute, it will create one, but if we already had a "Cash" attribute then it would just change its value

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

    Dhk

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

    Rhjo

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

    37th

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

    WWW

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

    dirty mac user

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

      Jonathan never liked you btw

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

      it doesnt matter i liked his son@@byteblox100

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

      :skull: