Every now and then I see colins in arguments. But I don’t really know what they mean. Example: function Data:AddPlayer(player: Player)
Can someone tell me?
Every now and then I see colins in arguments. But I don’t really know what they mean. Example: function Data:AddPlayer(player: Player)
Can someone tell me?
That is typing (don’t quote me on the name, probs wrong, just what I call it), and is not needed in luau, and I’m not sure if it even works, but basically…
player: Player -- Forces the variable player to "be" a Player
part: Instance -- Forces the variable part to "be" an Instance
-- If it is not, in langs like Typescript, it errors, but for luau I'm not sure
All this really means is that when calling this function…
local player = game.Players.LocalPlayer
local part = some.part.here
Data:AddPlayer(player) -- Works
Data:AddPlayer(part) -- Doesn't
-- And you instantly know from reading the typings
I am not sure if it does or doesn’t work in luau, but that is the general gist.
Oh thanks! I saw it in a script for a game I’m working on and it confused me quite a bit. But I think the person who wrote it is used to other languages. There were a few signs. But ty!