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

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

Asked by 8 years ago

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

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
8 years ago

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)
0
Thank you! It worked! :D Pandocool 5 — 8y
Ad
Log in to vote
0
Answered by
Scootakip 299 Moderation Voter
8 years ago

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

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. Pandocool 5 — 8y
0
You want to add the fire into the block... Before the block is created? How does that make any sense? Scootakip 299 — 8y

Answer this question