local function get_player(name: string): Player | nil
name = name:lower()
--...
end
I have this dummy function (literally just from a piece of code I saw).
What does the (name: string): Player | nil do? I know that ‘name’ is the parameter, ‘string’ is the parameter accepting type, but what is the colon ( : ) afterstring) for? And how does the pipeline character work?
function get_player(name: string?): Player?
if game:GetService("Players"):FindFirstChild(string.lower(name) then
return game:GetService("Players"):FindFirstChild(name) -- will return player.
end
end