I’ve tried placing this script in ServerScriptService:
local ThePart = Instance.new("Part",game.Workspace)
ThePart.Position = Vector3(1,1,1)
print("Working")
I don’t know why the output keeps telling me it needs a table. Is there something I’m missing? I thought this is right according to Instance.new. Thanks for the help, have a blessed day.
Missing .new
after Vector3
Also, in the future, it’s easier for us if you copy and paste the whole error
Ah thanks! Sorry, that was a really dumb mistake
change it to be Vector3.new on the third line
also its a better habit/ more optimal if your code was written like
local ThePart = Instance.new(“Part”)
ThePart.Parent = game.Workspace
Yes, I just realized that. So basically, you want your variables placed so that it is easier to work with?
TwoMadDev
(2Angry2Dev)
June 26, 2022, 10:39pm
#6
Please read this, you are using a bad coding practice for instance.new()
I’ve discovered a pretty bad performance issue in one of top games that has to do with Instance.new and wanted to write about this, since this is not obvious unless you know the system inside out.
Tthere are several ways to create a ROBLOX object in Lua:
local obj = Instance.new(‘type’); fill obj fields
local obj = Instance.new(‘type’, parent); fill obj fields
local obj = util.Create(‘type’, { field1 = value1, … })
If you care at all about performance, please only use the first option - I wi…
You know, I was just reading that as you were replying!