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 :)
like my teaching style? give me your email so I can send you stuff
byteblox.ck.page/c2af95d792
ok
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
@@CIA_Insights
do something like:
model.PrimaryPart.Position = vector3.new(0,0,0)
Or:
Model:MoveTo(0,0,0)
@@CIA_Insightsafter 6 month did u find it out
@@AnimeOfficalCW yes I did
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.
so does that imply that this could soon be deprecated?
hmm...
@@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
@@oriad7483 Leaderstats would be completely broken
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
Agreed. I've always used task.wait() since I discovered it
Nah it's not
I tested
And task.wait slower
@@ExoticFoxy me when i spread false information:
Woah, majestic dev?
@@berrysus4531 why would you
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
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
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.
it was all you bro
@@byteblox100 You're the one that put in the work, aren't you?
@@byteblox100 only 3 months and you're already at 18.5k, this is really insane, but don't get too cocky with it
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.
:remove() or :Remove() sets it to nil not destroy
@@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.
@@bioeless oh i didnt know i thought it just completely removed it well ok
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.
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.
Yes, I totally watch you on my MCDonalds 30 minute break.
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
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()
2:08 wait() is kinda deprecated and slow task.wait() is better than wait() every way its more accurate more preformant ect
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
Bro is posting everyday 🔥
They need to add instance references to attributes so i can make a solid serialization api for content based systems
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
Debris fixes that right
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.)
@@Nigma_863 you talk like queen from deltarune
@@SquooshyShark1000Thank's I Guess Lmao.. Hope you Have a Good Christmas Eve! :)
how exciting
attributes are too complicated to modify in scripts efficiently + takes too long to make a new one
values is a better choice
TYSM! I COULD MAKE A SKIN SYSTEM THAT VALUES EACH SKIN AS THEIR OWN VALUES AND NOT JUST A GUI!
i forgot attributes existed :D
i will now never use values again
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
:Destroy() doesn't "delete", it parents the part to nil. So the part still exists, it's just not in the workspace anymore.
@@pantommyhow to delete a part completely
SICK 🔥
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
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.) :)
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"))
u cant add objects into attributes
Hi
please do a video about meshparts next!
coudn't you achieve the same (cloning a part) by placing the part into ReplicatedStorage and cloning that?
use while true do task.wait() instead of while task.wait() end, theres a whole doc about this :P
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
@@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.
@@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
Can you make a tutorial on how to make a role require a badge
Read up on badge documentation
Any Instance can be stored
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?
Value will not sync as it does not exist on the client, so nil
Can you datastore objectvalues?
woa
interesting
2:11 its easier on the game
can you crate attributes using scripts?
:SetAttribute()
@@byteblox100 i meant create
@@rockyes3239thats actually how u do it
That's what you do, if you set an attribute that doesn't exist, it creates it@@rockyes3239
@@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
Dhk
Rhjo
37th
WWW
dirty mac user
Jonathan never liked you btw
it doesnt matter i liked his son@@byteblox100
:skull: