New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

[SOLVED] Sparkles won't change color?

Asked by
OniiCh_n 410 Moderation Voter
6 years ago

Okay, so everything is currently false until you click the brick. Assume the hierarchies are correct.

local part = script.Parent
local click = part.ClickDetector
local firstLearn = part.firstLearn
local alreadyLearned = part.alreadyLearned
local clicked = false

click.MouseClick:connect(function(plr)
    if plr.storage.skill_derp.Value == false and clicked == false then
        clicked = true
        plr.storage.skill_derp.Value = true
        local clone = firstLearn:clone()
        clone.Parent = plr.PlayerGui
        local sparkles = Instance.new("Sparkles", part)
        sparkles.SparkleColor = Color3.new(17, 238, 17) --Problem here; it won't change color! It just stays white instead of the neon green I wanted
        wait(5)
        sparkles:Destroy()
        print("Learned")
    elseif plr.storage.skill_derp.Value == true and clicked == false then
        clicked = true
        local clone2 = alreadyLearned:clone()
        clone2.Parent = plr.PlayerGui
        print("Learnt")
    else
        return false
    end
    wait(5)
    clicked = false
end)

2 answers

Log in to vote
2
Answered by
c0des 207 Moderation Voter
6 years ago

Try this...

local part = script.Parent
local click = part.ClickDetector
local firstLearn = part.firstLearn
local alreadyLearned = part.alreadyLearned
local clicked = false

click.MouseClick:connect(function(plr)
    if plr.storage.skill_derp.Value == false and clicked == false then
        clicked = true
        plr.storage.skill_derp.Value = true
        local clone = firstLearn:clone()
        clone.Parent = plr.PlayerGui
        local sparkles = Instance.new("Sparkles", part)
    local brickcolor = BrickColor.new("Lime green")
    local color = brickcolor.Color
        sparkles.SparkleColor = color
        wait(5)
        sparkles:Destroy()
        print("Learned")
    elseif plr.storage.skill_derp.Value == true and clicked == false then
        clicked = true
        local clone2 = alreadyLearned:clone()
        clone2.Parent = plr.PlayerGui
        print("Learnt")
    else
        return false
    end
    wait(5)
    clicked = false
end)

local brickcolor = BrickColor.new("Lime green") local color = brickcolor.Color

Ad
Log in to vote
1
Answered by 6 years ago

Sparkles use BrickColor, not Color3.

--Line 14
sparkles.SparkleColor = BrickColor.new("Lime green")
0
And now I refresh and see that you put the same exact answer as me, but I put the entire thing... :/ c0des 207 — 6y
0
You converted the brickcolor into color3, so that wouldn't work anyways... User#348 0 — 6y

Answer this question