Im currently creating a tycoon, And Im making a new upgrader "ore flamer" So, I was wondering if its upgrader can like. add a effect such as fire sparkles particles ect.
Heres the code:
script.Parent.Upgrader.Touched:connect(function(Part) if Part:FindFirstChild("Cash") then Part.Cash.Value = Part.Cash.Value + 5 end end)
But Im wondering if i can do this:
script.Parent.Upgrader.Touched:connect(function(Part) if Part:FindFirstChild("Cash") then Part.Cash.Value = Part.Cash.Value + 5 Add:Sparkles end end)
The code provided above could be accomplished but not through the use of "Add:Sparkles".
script.Parent.Upgrader.Touched:connect(function(Part) if Part:FindFirstChild("Cash") then Part.Cash.Value = Part.Cash.Value + 5 local sparkles = Instance.new("Sparkles", Part) end end)
I modified your code above from "Add:Sparkles" to local sparkles = Instance.new("Sparkles", Part). This line of code creates a "Sparkle" object in the part.