Hello! I browse the DevForum a lot, and when I look in #resources category, I often see functions written like this:
-- Example Instance.new function where the 2nd parameter can be used, but it has a concept!
local function CreateObject(ClassName: Name, Parent: Parent, TableForProperties: Table)
local Object = Instance.new(ClassName)
for Property, Value in pairs(TableForProperties) do
Object[Property] = Value
end
Object.Parent = Parent
return Object
end
local Object = CreateObject("Part", workspace, {Material = Enum.Material.Wood, Transparency = 0.5})
Why do they have
ClassName: Name
for example? What is it used for? If you could answer for me, please let me know. Thanks! WE
function lol(sasuke: string, naruto: string --[[type]]): string -- returns
return ('%s vs %s'):format(sasuke, naruto)
end
print(lol('sa sus ke', 'naruto us'))