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

Can tycoon upgraders add effects to dropper blocks?

Asked by 8 years ago

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)

1 answer

Log in to vote
0
Answered by 8 years ago

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.

Ad

Answer this question