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
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
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
@@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 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
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 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
@@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
So underrated, You show really useful things that other youtubers don't show. Thanks u a lot
Thanks :D Glad you enjoyed!
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
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
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
@@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
@@legendsiscool can you tell me what you use it for? and a more easier example
@@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
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
So useful for clean coding in roblox !! 🙌 thanks a lot guy
Happy to help :D
Solid Info. TY
Glad you enjoyed :D
thanks a lot for this video much better than the other confusing ones :D
Will you do a video about saving your data for the shop guide series
Are you able to give the annotations/types descriptions? As to further explain how it can be used and such, like the Roblox types.
solid info, appreciated.
Glad it was helpful!
Love the vids. They are so useful
Glad you enjoy, thanks :D
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.
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
That would help alot
At 17:40 can't we assert the type?
module.TestNumber = 10 :: number
this actually helps me understand, you're the best
Thanks, I'm glad I could help :D
You don't need to enable strict script mode to enable type-checking.
Oh my apologies, thanks for the correction. I believe you might have had to do this at one point, but maybe I’m misremembering.
@@MonzterDEV You need to enable it for errors to pop up in the output, but not for intellisense
I wonder what it supposed to do when people do return type (value) or export type (value)..
I wonder what the "Type" is for.?
whole video is about it.....type is like typeof but from lua also@@KageNoDragon
can you update the simulator playlist with new videos?
Simulator episodes release every Friday. Are you referring to one missing from the Playlist?
oh, i didn't know that, thx for telling me
When is the next pet system video coming out?
Every Friday is a Simulator video!
@@MonzterDEV it's friday when will the video come out
for Singleton couldn't you just use tables?
What do you mean?
@@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
@@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
@@bubblas5536 good point!
@@bubblas5536
if results[1 or 2 or 3 or 4] == "Declined" then
11:33
YIPPEEEEEEEEEEEEEEEEEEEEEEE
Hope it helps!
3:54 hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm bic?
Suspicious..
Lol, you can see my button presses were slightly off to the left.
boo lean
Key "LoadProfileAsync" not found in table ProfileStore ..?