Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does Instance.new() use a period and not a colon?

Asked by 4 years ago

I looked at the Instance class on the API reference and it mentioned that Instance.new() was a function. If it is a function, how come it uses a period instead of a colon?

1 answer

Log in to vote
1
Answered by
Grazer022 128
4 years ago

Instance.new() uses a period because that’s how Roblox programmed it to be. It’s a type of built in function made also by roblox to insert objects automatically while the game is running. It doesn’t use a colon because it’s the type of built in function that performs differently than others. Take this for an example

local newPart = Instance.new(“Part”, game.Workspace)

local destroyNewPart = newPart:Destroy()

Instance.new() is an independent function while other built in functions rely on an Instance. hope this helps and I hope you understand!

Ad

Answer this question