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

Is it available to use colon two times in this script?

Asked by 3 years ago

Hello, thanks for your coming. It is not a big question but I am just trying to know is it allowed to do this such as:

Instance.new(“Part”, game:GetService(“Workspace”)).Name = “test"
game:GetService(“Workspace”):WaitForChild(“test”).CFrame = CFrame.new(0,30,0)

I know that this script is unnecessary and you do not need to do that but I just came up this question while playing the game, is it allowed and available to do it?

0
thanks for asking this AlexanderYar 788 — 3y

1 answer

Log in to vote
2
Answered by 3 years ago

This is definitely allowed and will work. I do recommend assigning the instance to a variable if you're going to reference it again though.

local test = Instance.new(“Part”, game:GetService(“Workspace”)).Name = “test"
test.CFrame = CFrame.new(0,30,0)
Ad

Answer this question