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

How to add fire to this?

Asked by 10 years ago
local distance = (position - tool.Muzzle.CFrame.p).magnitude
        local rayPart = Instance.new("Part", tool)
        rayPart.Name          = "RayPart"
        rayPart.BrickColor    = BrickColor.new(194)
        rayPart.Transparency  = 0
        rayPart.Anchored      = true
        rayPart.CanCollide    = false
        rayPart.TopSurface    = Enum.SurfaceType.Smooth
        rayPart.BottomSurface = Enum.SurfaceType.Smooth
        rayPart.formFactor    = Enum.FormFactor.Custom
        rayPart.Size          = Vector3.new(2, 5, 2)
        rayPart.CFrame        = CFrame.new(position, tool.Muzzle.CFrame.p) * CFrame.new(0, 0, 1) * convertToCFrameDegrees(90, 0, 0)
        local rayMesh = Instance.new("CylinderMesh",rayPart)
        rayMesh.Scale = Vector3.new(1,1,1)
        rayMesh.Offset = Vector3.new(0, -distance + rayMesh.Scale.y/2, 0)
--      rayMesh.Scale = Vector3.new(1,distance,1)
--      rayMesh.Offset = Vector3.new(0, -distance/2, 0)

0
Just add [local Fire = Instance.new("Fire",rayPart)]. :P TheeDeathCaster 2368 — 10y
0
With or without the brackets? TheRings0fSaturn 28 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

We could use the Instance.new function to create the said object inside of rayPart.

Instance.new('Fire',rayPart);

This should create the Fire class inside the second argument of Instance.new, which is it's parent.

Hope this helped.

Ad
Log in to vote
-2
Answered by 10 years ago

raypart.Instance.new("Fire")

put this at the end of ur script and i think it should work

0
well, really u could put it anywhere FastSnail5 8 — 10y
0
also could u accept the answer if it works? thanks! FastSnail5 8 — 10y

Answer this question