so I tried scripting this script and put it inside a gun tool since my gun just needs some realistic feels (smoke appears when you shoot).
somehow when I shoot with my gun the smoke doesn't appear.
the script:
local Tool = script.Parent Tool.Equipped:Connect(function(Mouse) Mouse.Button1Down:Connect(function() Instance.new("Smoke", script.Parent.Handle) wait(2) script.Parent.Handle.Smoke:Destroy() end) end)
I'm pretty new at scripting so I mostly got the script from a roblox wiki tutorial and just edited it.
it is a normal script and is inside the tool.
Use Activated()
That all you need to change
local Tool = script.Parent Tool.Activated:Connect(function() Instance.new("Smoke", script.Parent.Handle) wait(2) script.Parent.Handle.Smoke:Destroy() end)
More about Tool
Try adding a position, smoke particles need a position for the emitter, and you didn't specify the position, so try doing this:
local Tool = script.Parent Tool.Equipped:Connect(function(Mouse) Mouse.Button1Down:Connect(function() local smoke = Instance.new("Smoke", script.Parent.Handle) smoke.Position = script.Parent.Handle.Position wait(2) script.Parent.Handle.Smoke:Destroy() end) end)
Hope I could help!