So i was just messing with functions and methods, and I saw things like
RaycastResult Raycast(Vector3 origin, Vector3 direction, RaycastParams raycastParams)
Instance FindFirstChild(string name, bool recursive)
from what I understand, the one on the left, is the type, and on the right is the use or something. So I thought, what if I can do this, I tested stuff like
function myFunction(argument number)
end
function myFunction2(argument: number)
end
the myFunction2 does not seem to error, but when I change it like
function myFunction2(argument: type(number))
end
function myFunction2(argument: "number")
end
function myFunction2(argument: )
end
it errors, but the error message says
Syntax Error: Expected type, got 'blah blah'
it said expected type, and so I thought the type is the right one, and the variable im using is the left one. I got confused as when using methods, the type is on the left.
Correct me if I said something wrong since those are what I understand, anyways what is the use of type when creating functions?
I searched for things like this but the results is not what I wanted