Luau Type Checking - Roblox Scripting Tutorial

  Рет қаралды 16,309

Suphi Kaner

Suphi Kaner

Күн бұрын

Пікірлер: 78
@dad8102
@dad8102 Жыл бұрын
Can you make a video about custom state machines, how to make a simple one and how you can use it for both players and npc I think it would be very useful for beginners.
@Guwd208
@Guwd208 Жыл бұрын
I second this, would be great
@Glitchey
@Glitchey Жыл бұрын
I hope he made video about this.
@Glitchey
@Glitchey Жыл бұрын
Hello there Suphi, can you make a tutorial about "Behaviour Tree" and implimentaions in NPC AI?
@emotionallydeprived1889
@emotionallydeprived1889 11 ай бұрын
Agreed
@Marcus001
@Marcus001 Жыл бұрын
This is an awesome feature
@PipsJacob
@PipsJacob Жыл бұрын
can you make a noob to pro scripting series sir
@BugerGFX
@BugerGFX Жыл бұрын
Hey! can you make like a noob to pro scripting tutorial with each episode you teach something new
@JPEGArtifact
@JPEGArtifact Жыл бұрын
Type chicken 🤤
@KLevn_
@KLevn_ Жыл бұрын
huh, i thought i did everything on typechecking. I've learned something new today. Can you please make video about Generics for the follow up? i've read the docs and i dont know what it does.
@sin_2
@sin_2 Жыл бұрын
dont forget to like the video
@GamingMasterMind3000
@GamingMasterMind3000 Жыл бұрын
I would love it if you made a gun video that covered pistol type guns and automatic guns (and possibly shotguns that spreadshot).
@METOPv2
@METOPv2 Жыл бұрын
I just was thinking today "Ohh when Suphi will make video about type checkin"
@aarongamerph
@aarongamerph Жыл бұрын
Thank you! I never knew about this and often get confused on why there's Colons on function variables but now I know, and I will now be starting using it on my scripts, thank you!
@MMMasterLego
@MMMasterLego Жыл бұрын
this will definitely be useful in my next project thanks for all the great video's
@ZeroWZM
@ZeroWZM Жыл бұрын
Ik you most likely won’t see this but would you ever make or consider making a beginner scripting series
@5uphi
@5uphi Жыл бұрын
Have you watched this video? kzbin.info/www/bejne/o4uwpoqhmJWWj8k it's a good one for beginners hopefully I'll have more videos for beginners in the future
@ZeroWZM
@ZeroWZM Жыл бұрын
@@5uphi thank you I’ll be sure to check it out I was looking through you’re page and was confused on where to start 😂
@5uphi
@5uphi Жыл бұрын
Other than the snake video my other videos are not designed for beginners hopefully I'll have more beginner friendly videos in the future and I'll put them all in a playlist
@slyers04
@slyers04 Жыл бұрын
Could you explain generic types and generic functions? The Luau docs don't explain it in a way I can understand
@il1ekp1e4
@il1ekp1e4 Жыл бұрын
haha nope Slyers!
@Anobot
@Anobot Жыл бұрын
This is a pretty helpful tip when working on module scripts
@guestboy342
@guestboy342 Жыл бұрын
Thanks for doing my suggestion! Or you coincidentally thought of this idea after I wrote my comment on your last video, it wasn't very clear. Anyways, I've understood it after this video! I have another suggestion for a video. It could be about string.format() or the string library and again, some use-cases of using them.
@Kitsune_Dev
@Kitsune_Dev Жыл бұрын
Can you do a video on how to use VSCode and Rojo
@Testbot379
@Testbot379 Жыл бұрын
Basically is it like Statically typed language like C++?
@CloverKismet
@CloverKismet 4 ай бұрын
Super epic, thanks!
@akram-qn6my
@akram-qn6my Жыл бұрын
Keep going bro
@DimoDimoo
@DimoDimoo Жыл бұрын
Question: what are good scenarios to use type checking and what are some bad scenarios?
@5uphi
@5uphi Жыл бұрын
It's personal preference it would be like asking what are some good scenarios when to add ketchup to your food
@shreddedOrphans
@shreddedOrphans Жыл бұрын
hey I understand that is it functionally the exact same but in the documentation for module scripts it says to put them inside of serverScriptService. I just thought u might want to know!!
@PluffPenguin
@PluffPenguin Жыл бұрын
Thank you! This was very helpful. Is there a way to do type-checking with metatables? Specifically the self variables. I tried doing something like self.name : string = "Template", but with no luck.
@5uphi
@5uphi Жыл бұрын
You can do module.Func = function(self : myType) end You can also cast the type by doing self :: myType Or you can move self into a different variable local object : myType = self
@cgl4de
@cgl4de Жыл бұрын
You could create custom types using the `type` keyword. Example: `type myCustomType = {Name: string, value: any}` and then type cast `self` to the type; local self = setmetatable(myTable, myMetaTable) :: myCustomType;
@uliveulearnandregret
@uliveulearnandregret Жыл бұрын
@@5uphi thanks with this knowledge I made an object creator/editor no ui for it yet
@marinavandelft3072
@marinavandelft3072 Жыл бұрын
Can you do a tutorial of how to script like a realm unlock GUI like in a Find the game? If you don't know what I mean, look at like Find the Chomiks realm unlock, or Find the Toasties realm unlock. Please, make a tutorial about this. It's been driving me crazy knowing how to do this!
@ultrio325
@ultrio325 Жыл бұрын
There are a lot of instances where I've gone "No, I don't care that you can't see metafunctions, the code works fine and you're gonna shut up" and put a --!nocheck up front
@Smurfis
@Smurfis Жыл бұрын
How I don’t use the feature of multiple screens because I use a laptop is beyond me.
@jam5936
@jam5936 Жыл бұрын
Essentially type checkikg makes the code more readable and easier to understand?
@5uphi
@5uphi Жыл бұрын
Some might say it makes it less readable but essentially its to give you a warning if you use the incorrect type
@jam5936
@jam5936 Жыл бұрын
Seems worth it to me @@5uphi
@ПокровскийМихаил-е9ц
@ПокровскийМихаил-е9ц Жыл бұрын
give tutorial for procedural animation
@5uphi
@5uphi Жыл бұрын
Have you watched this video kzbin.info/www/bejne/bpe5XouFhM9phZY
@costo.
@costo. Ай бұрын
What about (type) -> ()?
@5uphi
@5uphi Ай бұрын
() -> () is a function type and a (number) -> () is a function that has a number parameter and () -> number is a function that returns a number
@payh1591
@payh1591 Жыл бұрын
You should consider creating a udemy course
@Xarphine
@Xarphine Жыл бұрын
You make really great videos for roblox developers I think your channel deserves way more than 10k subs!
@74L
@74L Жыл бұрын
Another amazing video by our favorite dev youtuber
@codes8300
@codes8300 Жыл бұрын
Finally! Been waiting for this moment!
@uliveulearnandregret
@uliveulearnandregret Жыл бұрын
this is a great video however I tried to do this with more functions inside the tables along with using self, I made a metatable, the first type is always string or whatever I set it as and the types after are always any...
@manuedz
@manuedz Жыл бұрын
this was so convenient. i was literally trying to learn how to use modules organised and this video pop out amazing
@hdbsbejfbbf1864
@hdbsbejfbbf1864 Жыл бұрын
How can I implement this with oop, I couldn’t figure out how to have self with autocomplete
@5uphi
@5uphi Жыл бұрын
You can do module.Func = function(self : myType) end You can also cast the type by doing self :: myType Or you can move self into a different variable local object : myType = self
@kif-zallrhat1870
@kif-zallrhat1870 Жыл бұрын
I know about this but I have absolutely no idea what to use it for. I always set my variable names in a way I know what their type, and I tend to remember how my codes work. Perhaps it will be handy for team creates and publishing open source code.
@execute214
@execute214 8 ай бұрын
when you need help from other people, seeing a return type of a function, looking at your own code in the future etc
@goreacraft
@goreacraft Жыл бұрын
at 13:00 can "vector3.X = x :: number" be a valid solution?
@5uphi
@5uphi Жыл бұрын
no x is already considered as a number so doing that has zero effect
@username-l7e
@username-l7e Жыл бұрын
Type chicken lol
@ExePlr3270
@ExePlr3270 Жыл бұрын
Gracias por enseñarnos algo nuevo.
@kroomyw
@kroomyw Жыл бұрын
didn't type checking affected the game before?
@5uphi
@5uphi Жыл бұрын
no
@jaszczurka5069
@jaszczurka5069 Жыл бұрын
so this doesn't do better for performance, right?
@5uphi
@5uphi Жыл бұрын
At this current time has no effect in game
@UsuallyMurdering
@UsuallyMurdering Жыл бұрын
I'm trying to make a question type game and I'm want to use the same buttons and script for each questions. When I add multiple functions in one script they all run at the same time, was wondering if there was a way to stop one function then use another in the same script. If not, do I just have to make multiple scripts and run them?
@vermilion4215
@vermilion4215 Жыл бұрын
I think what you need is coroutines
@uliveulearnandregret
@uliveulearnandregret Жыл бұрын
for me I use task.wait() and I use boolean values you can use it to flip flop through your questions one at a time, I'll give you an example I made a button that teleports me vertically the same way back and forth 500 studs each, but when I press that button I don't move anywhere why? because I was teleported twice in less than a second, that's the same problem you are having, I made a boolean value set itself to false or true when I press the button, we still get the same issue, so we instead have to add a task.wait() right above where we change the value to true or false, you get it?
@aze2795
@aze2795 Жыл бұрын
todays tutorial was really helpful, thanks!
@5uphi
@5uphi Жыл бұрын
Glad it was helpful!
@Sand.
@Sand. Жыл бұрын
oh this sounds cool
@ritsu9837
@ritsu9837 Жыл бұрын
First
@Xanthodion
@Xanthodion Жыл бұрын
Luau!
@m_r5723
@m_r5723 Жыл бұрын
i got a question. What does the double colon symbol mean in coding, as i've seen it alot in modules that deal with exports and typechecking, typically somewhere in the end of the module placed a :: Also very compherensive and easy to understand tutorial organized into a short video, thanks!
@tower9602
@tower9602 Жыл бұрын
:: is mostly comes from C++, from what I know luau does not have any non string purpose of ::
@5uphi
@5uphi Жыл бұрын
It's to cast a type onto something So doing variable :: number indicates the variable is a number
@tower9602
@tower9602 Жыл бұрын
@@5uphi I think you have to use one : instead of two, correct me if I'm wrong
@5uphi
@5uphi Жыл бұрын
You use 1 when setting the variable to a type but use 2 to cast the variable something like this local function Func(x : number) return x :: string end
@tower9602
@tower9602 Жыл бұрын
@@5uphi oh so it's more of telling what function will return as a result, ok thanks
@miffclick3358
@miffclick3358 Жыл бұрын
Good for working with other people. But nothing fir optimization
Hoverboard - Roblox Scripting Tutorial
41:41
Suphi Kaner
Рет қаралды 34 М.
Content Streaming - Roblox Scripting Tutorial
29:24
Suphi Kaner
Рет қаралды 20 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 5 МЛН
Start using Type Checking in Roblox! Roblox Development Tips
18:44
METATABLES | What are they and how can we use them?
18:40
Crusherfire
Рет қаралды 22 М.
Type Annotation in Roblox Studio!
28:47
Crusherfire
Рет қаралды 7 М.
What is Object Oriented Progamming?
13:27
GnomeCode
Рет қаралды 40 М.
Projectile Physics - Roblox Scripting Tutorial
17:47
Suphi Kaner
Рет қаралды 94 М.
What Is The Best AI For Roblox Studio Scripting?
10:42
RoDev
Рет қаралды 445 М.
Metatables - Roblox Scripting Tutorial
23:21
Suphi Kaner
Рет қаралды 26 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 5 МЛН