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!
@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.
@MMMasterLego
Жыл бұрын
this will definitely be useful in my next project thanks for all the great video's
@manuedz
Жыл бұрын
this was so convenient. i was literally trying to learn how to use modules organised and this video pop out amazing
@Anobot
Жыл бұрын
This is a pretty helpful tip when working on module scripts
@codes8300
Жыл бұрын
Finally! Been waiting for this moment!
@Xarphine
Жыл бұрын
You make really great videos for roblox developers I think your channel deserves way more than 10k subs!
@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
Жыл бұрын
I second this, would be great
@Glitchey
Жыл бұрын
I hope he made video about this.
@74L
Жыл бұрын
Another amazing video by our favorite dev youtuber
@CloverKismet
4 ай бұрын
Super epic, thanks!
@Glitchey
Жыл бұрын
Hello there Suphi, can you make a tutorial about "Behaviour Tree" and implimentaions in NPC AI?
@emotionallydeprived1889
11 ай бұрын
Agreed
@GamingMasterMind3000
Жыл бұрын
I would love it if you made a gun video that covered pistol type guns and automatic guns (and possibly shotguns that spreadshot).
@akram-qn6my
Жыл бұрын
Keep going bro
@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.
@BugerGFX
Жыл бұрын
Hey! can you make like a noob to pro scripting tutorial with each episode you teach something new
@METOPv2
Жыл бұрын
I just was thinking today "Ohh when Suphi will make video about type checkin"
@ZeroWZM
Жыл бұрын
Ik you most likely won’t see this but would you ever make or consider making a beginner scripting series
@5uphi
Жыл бұрын
Have you watched this video? kzitem.info/news/bejne/zpCD24uhnGKUjJw it's a good one for beginners hopefully I'll have more videos for beginners in the future
@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
Жыл бұрын
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
@PipsJacob
Жыл бұрын
can you make a noob to pro scripting series sir
@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!!
@ExePlr3270
Жыл бұрын
Gracias por enseñarnos algo nuevo.
@slyers04
Жыл бұрын
Could you explain generic types and generic functions? The Luau docs don't explain it in a way I can understand
@il1ekp1e4
Жыл бұрын
haha nope Slyers!
@Testbot379
Жыл бұрын
Basically is it like Statically typed language like C++?
@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
@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
Жыл бұрын
:: is mostly comes from C++, from what I know luau does not have any non string purpose of ::
@5uphi
Жыл бұрын
It's to cast a type onto something So doing variable :: number indicates the variable is a number
@tower9602
Жыл бұрын
@@5uphi I think you have to use one : instead of two, correct me if I'm wrong
@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
Жыл бұрын
@@5uphi oh so it's more of telling what function will return as a result, ok thanks
@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
Жыл бұрын
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
Жыл бұрын
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
Жыл бұрын
@@5uphi thanks with this knowledge I made an object creator/editor no ui for it yet
@Sand.
Жыл бұрын
oh this sounds cool
@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...
@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!
@JPEGArtifact
Жыл бұрын
Type chicken 🤤
@DimoDimoo
Жыл бұрын
Question: what are good scenarios to use type checking and what are some bad scenarios?
@5uphi
Жыл бұрын
It's personal preference it would be like asking what are some good scenarios when to add ketchup to your food
@Smurfis
Жыл бұрын
How I don’t use the feature of multiple screens because I use a laptop is beyond me.
@Kitsune_Dev
Жыл бұрын
Can you do a video on how to use VSCode and Rojo
@hdbsbejfbbf1864
Жыл бұрын
How can I implement this with oop, I couldn’t figure out how to have self with autocomplete
@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
@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
Жыл бұрын
I think what you need is coroutines
@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?
@jam5936
Жыл бұрын
Essentially type checkikg makes the code more readable and easier to understand?
@5uphi
Жыл бұрын
Some might say it makes it less readable but essentially its to give you a warning if you use the incorrect type
@jam5936
Жыл бұрын
Seems worth it to me @@5uphi
@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
9 ай бұрын
when you need help from other people, seeing a return type of a function, looking at your own code in the future etc
@kroomyw
Жыл бұрын
didn't type checking affected the game before?
@5uphi
Жыл бұрын
no
@goreacraft
Жыл бұрын
at 13:00 can "vector3.X = x :: number" be a valid solution?
@5uphi
Жыл бұрын
no x is already considered as a number so doing that has zero effect
@jaszczurka5069
Жыл бұрын
so this doesn't do better for performance, right?
@5uphi
Жыл бұрын
At this current time has no effect in game
@sin_2
Жыл бұрын
dont forget to like the video
@ПокровскийМихаил-е9ц
Жыл бұрын
give tutorial for procedural animation
@5uphi
Жыл бұрын
Have you watched this video kzitem.info/news/bejne/mZyMk4yFiJxngmk
@costo.
Ай бұрын
What about (type) -> ()?
@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
@Xanthodion
Жыл бұрын
Luau!
@payh1591
Жыл бұрын
You should consider creating a udemy course
@ritsu9837
Жыл бұрын
First
@username-l7e
Жыл бұрын
Type chicken lol
@miffclick3358
Жыл бұрын
Good for working with other people. But nothing fir optimization
Пікірлер: 78