Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Part keeps changing size?

So I was doing a one script challenge to make a building. I started with the base, here's the code

print("-")
base = Instance.new("Part")
base.Anchored = true
base.Parent = game.Workspace
base.Name = "Base"
base.Size = Vector3.new("30,5,30")
base.Position = Vector3.new("0,0,0")
base.Color = Color3.new("0,255,255")

Now when I tested it, the size was 0.05, 0.05, 0.05 when I modified the size in the Explorer, I couldn't find it. Also the base.Color ends up as 0,0,0. This base will sit on the baseplate, I couldn't find it even when I removed the baseplate

1 comment

0

Any Solutions?

1 answer

✓ Accepted answer

So first of all, when you're making a new Vector3 value using Vector3.new, the paramaters you have to put in are the x, y and z components, you did that but as you can see you put them in as a string, like this "30,5,30", when really you have to do this 30,5,30, its not a string that you have to put as the paramater its just all plane numbers, you can even add spaces to makes it cooler 30, 5, 30` and the amount of spaces doesn't really matter cause rememeber the lua syntax.

And that also implies to the Color3, all though there is also another problem with that and that is, you are using Color3.new, and this guy takes a number between 0 and 1, not 0 and 255. So yeah, and in general Color3**.new** isn't used a lot, so yeah you wanna always use Color3**.fromRGB** which is the one that takes 0 to 255, so an rgb value. And remember to remove the strings.

print("-")
base = Instance.new("Part")
base.Anchored = true
base.Parent = game.Workspace
base.Name = "Base"
base.Size = Vector3.new(30, 5, 30)
base.Position = Vector3.new(0, 0, 0)
base.Color = Color3.new(0, 255, 255)

This discussion is preserved as it was. New answers, comments, and votes are closed.