#Can somebody help me with this type of parameters?

8 messages · Page 1 of 1 (latest)

feral lava
#

I mean: " player: Player "

#

im in scripting for 3 month and i see this thing often so i would like to know what is that, can someone send me a video with this type of parameters or maybe devforum/roblox documentation?

strange walrus
#

it doesnt have any effect other than reminding you of what it is. If you manually set the type of a variable in the parameters of a function (like the one in the image) it will autocomplete and show you that type when you are filling the parameters from the other side. This is not that useful in most situations but there is a common beginners mistake where you forget that remote events/functions pass down the player as the first argument even if you dont pass it, so it is just a reminder.

fresh osprey
#

as veulem said, remote events pass down player as the first argument even if you dont pass it.

dreamy hatch
# feral lava im in scripting for 3 month and i see this thing often so i would like to know w...

As most people have said before, that's called "Type Hinting." It (kinda) doesn't do anything coding-wise, but it's a helpful way to let yourself and anyone else who is looking at your code figure out what a variable is supposed to hold or what values a function is supposed to return. It's also good for hinting to autocomplete what you're trying to type. Finally, if you put --!strict at the top of your script, your code will warn/error if a value gets passed into a type-hinted variable that doesn't match up with the type you hinted for. Good for debugging, ig. You could probably google how to use type hinting pretty easily, but there's a good dev forum tutorial about it here: https://devforum.roblox.com/t/type-checking-for-beginners/1027242

feral lava
#

okay thanks for everyone