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

How am I supposed to format a numbers in an argument?

I am experimenting with parameters right now and I don't know how to format the numbers. Here is the code I wrote.

local function GenerateParts(PartColor,Place,Clearness) local APart = Instance.new("Part",game.Workspace)

APart.BrickColor = BrickColor.new(PartColor)
APart.Position = Place
APart.Transparency = Clearness

end

GenerateParts("Artichoke",(90.18, 24.5, -12),(0.5))

I always see red lines under the "(90.18, 24.5, -12),(0.5))", and when I run the game it says (Workspace.Instancing:10: Expected ')' (to close '(' at column 27), got ',').

Please tell me how to format it if you know how to!

2 comments

0

You have to do Vector3.new(Values), not just (Values), and you can leave the ()s at the Clearness.

0

GenerateParts("Artichoke",Vector3.new(90.18, 24.5, -12),0.5)

1 answer

✓ Accepted answer

Here's the working Script.

-- Part Creators (creditFerrarimamiPls)
local function GenerateParts(PartColor,Place,Clearness) 
	local APart = Instance.new("Part",game.Workspace)
APart.BrickColor = BrickColor.new(PartColor)
APart.Position = Place
APart.Transparency = Clearness

end

GenerateParts("Artichoke",Vector3.new(90.18, 24.5, -12),0.5)

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