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

How do you use Instance.new?

Asked by 9 years ago

This is what i had

m = Instance.new("Message")

m.Text = "hello"

2 answers

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

You need to parent your newly created instance(:

You can do this with the second argument of the Instance.new function, which is the parent the created instance will go into.

--This would make the message go into workspace.
m = Instance.new("Message",workspace)

m.Text = "hello"

Alternatively, you can set the Parent property of the m to workspace

m = Instance.new('Message')

m.Text = 'Hello'
m.Parent = workspace
Ad
Log in to vote
0
Answered by 9 years ago

You can use Instance.new To make new parts,messages,scripts,etc. You can set parent to send to the root thats a part thats the propety belongs to workspace and to itself.

Heres a script: Problem:You want to make a part thats transpeceny is 0.5 and you want to make it propety of workspace.

Part = Instance.new("Part",Workspace)
Part.Transpency = 0.5

Part.Parent = Workspace
end

Now your happy?This is the basics of scripting in roblox.Use it.Its FREAKING important.

0
P.S Sorry of my english guyalf1 0 — 9y

Answer this question