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

How to insert smoke into a part via script?

Asked by
Scerzy 85
9 years ago

I have this script here

:ls num=3.5
mouse=game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key)
if key:lower()=="q" then
num=4.5
end
if key:lower()=="e" then
num=2.5
end
end)
mouse.KeyUp:connect(function(key)
num=3.5
end)
m=Instance.new("Part",workspace)
m.Name="Float"
m.FormFactor=0
m.BottomSurface="Smooth"
m.TopSurface="Smooth"
m.Size=Vector3.new(6,1,6)
m.BrickColor=BrickColor.new("HiOutlast")
m.Anchored=true
p=Instance.new("PointLight",m)
p.Range=20
p.Color=Color3.new(0,0,1)
m2=m:clone()
m.BrickColor=BrickColor.new("Really black")
m2.Parent=workspace
c=0
c2=45
while wait() do
c=c+22.5
c2=c2+22.5
p=game.Players.LocalPlayer.Character.HumanoidRootPart.Position
--game.Players.LocalPlayer.Character.Torso.CFrame=game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,-(num)+3.5,0)
m.CFrame=CFrame.new(p.X,p.Y-num,p.Z)*CFrame.Angles(0,math.rad(c),0)
m2.CFrame=CFrame.new(p.X,p.Y-num,p.Z)*CFrame.Angles(0,math.rad(c2),0)
end

How would I add smoke or fire into the parts being spawned under me?

1
Could you edit the post so that the code is inside a code block? It's easier to read that way. Spongocardo 1991 — 9y
0
Sorry, didn't notice Scerzy 85 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

First, it seems that you're using an admin command to make the script, so I just left the ":ls" in the script.

Second, just create a Smoke/Fire object before the Float part is cloned into m2, like this.

:ls num=3.5
mouse=game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key)
if key:lower()=="q" then
num=4.5
end
if key:lower()=="e" then
num=2.5
end
end)
mouse.KeyUp:connect(function(key)
num=3.5
end)
m=Instance.new("Part",workspace)
m.Name="Float"
m.FormFactor=0
m.BottomSurface="Smooth"
m.TopSurface="Smooth"
m.Size=Vector3.new(6,1,6)
m.BrickColor=BrickColor.new("HiOutlast")
m.Anchored=true
p=Instance.new("PointLight",m)
p.Range=20
p.Color=Color3.new(0,0,1)
s=Instance.new("Smoke",m) --You can add code underneath to change the smoke's size, color, etc. Also, change Smoke to Fire if you want fire.
m2=m:clone() --The smoke should carry over to the clone.
m.BrickColor=BrickColor.new("Really black")
m2.Parent=workspace
c=0
c2=45
while wait() do
c=c+22.5
c2=c2+22.5
p=game.Players.LocalPlayer.Character.HumanoidRootPart.Position
--game.Players.LocalPlayer.Character.Torso.CFrame=game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,-(num)+3.5,0)
m.CFrame=CFrame.new(p.X,p.Y-num,p.Z)*CFrame.Angles(0,math.rad(c),0)
m2.CFrame=CFrame.new(p.X,p.Y-num,p.Z)*CFrame.Angles(0,math.rad(c2),0)
end
0
Thanks a lot. I have it saved in a document because I use them as admin commands, so disregard the :ls. Thanks again! Scerzy 85 — 9y
Ad

Answer this question