Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED] Sparkles won't change color?

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

✓ Accepted answer

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

Sparkles use BrickColor, not Color3.

--Line 14
sparkles.SparkleColor = BrickColor.new("Lime green")

2 comments

0

And now I refresh and see that you put the same exact answer as me, but I put the entire thing... :/

0

You converted the brickcolor into color3, so that wouldn't work anyways...

This discussion is preserved as it was. New answers, comments, and votes are closed.