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

How do I include the fire properties while creating a block from coding?

I need help on how to make the instance.new fires parent the block that's being created by the Instance code.

Here's the coding


-- Yes

local yes = Instance.new("Part",workspace) --Instantiate a Part, as a child of the workspace


yes.Anchored = true
yes.BrickColor = BrickColor.new("Lime green")
yes.Name = "Lime part"
yes.Position = Vector3.new(-210, 1.69, 227)
yes.Material = "Neon"

local boom = Instance.new("Fire", yes.Parent)
boom.Color = Color3.new(0 , 0, 255)
boom.SecondaryColor = Color3.new (0, 255, 127)
boom.Enabled = true
boom.Heat = 15
boom.Name = "Yomi Comobi"
boom.Size = 5


local hint = Instance.new("Hint", workspace)
hint.Text = "The name of the part we created is: " .. yes.Name

2 answers

✓ Accepted answer

The parameters to Color3.new are in the range 0 to 1, not 0 to 255. You have to scale the numbers down by a factor of 1/255 from what you see in the Properties panel:

boom.Color = Color3.new(0/255, 0/255, 255/255)
	-- or Color3.new(0, 0, 1)

boom.SecondaryColor = Color3.new(0, 1, 0.5)
	-- or Color3.new(0/255, 255/255, 127/255)

If you want boom to be a child of yes, then just yes is the parent you should given to Instance.new. yes.Parent is just workspace, which will put boom inside the Workspace (and not in any particular part)

boom = Instance.new("Fire", yes)

1 comment

0

Thank you! It worked! :D

Do you want the fire to be in the block? Cuz I'm pretty sure that fire needs to be in a block to work.

-- Yes

local yes = Instance.new("Part", game.Workspace) --Instantiate a Part, as a child of the workspace


yes.Anchored = true
yes.BrickColor = BrickColor.new("Lime green")
yes.Name = "Lime part"
yes.Position = Vector3.new(-210, 1.69, 227)
yes.Material = "Neon"

local boom = Instance.new("Fire", yes)
boom.Color = Color3.new(0 , 0, 255)
boom.SecondaryColor = Color3.new (0, 255, 127)
boom.Enabled = true
boom.Heat = 15
boom.Name = "Yomi Comobi"
boom.Size = 5


local hint = Instance.new("Hint", workspace)
hint.Text = "The name of the part we created is: " .. yes.Name

2 comments

0

I'll try to explain as less blunt as possible. What I'm trying to do is add the fire in the block before the block is created. In other words, I want the fire to be in the block after I hit the run button, instead of putting the fire inside the block using studio.

0

You want to add the fire into the block... Before the block is created? How does that make any sense?

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