What does this in functions do?

Pretty much, I saw somewhere where a module had put the following:

(Not my code but it has what i mean.)

function WindShake:AddObjectShake(object: BasePart, settingsTable: WindShakeSettings?)

end

You see how it says “object: BasePart”? Yeah, I’m wondering if that works, What it does, And what happens if you don’t put a basepart instance but for example a table?

EDIT
This is LuaU, more information: https://luau-lang.org/

LuaU allows you to make it so only certain instances can be used in a module function’s arguments?

object here is just to reference what type it is (BasePart).
It doesn’t necessary need to be that type either, you are free to edit it to whatever you want, as long as you reference it by the new name.

So actually adding a thing such as lets say “players: Table” doesn’t actually do anything diffrent from just making “players”?

Just read the link I sent you, I program in the original lua language, not the Roblox one.
You’ll find out eventually.

Alright thanks, I’ll check it out

1 Like