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

Why is this not adding 1 to the value and not changing the BrickColor?

Why is this not adding 1 to the value and not changing the BrickColor?

The script is a localscript.

There is no errors.

What am I doing wrong?

Any help is greatly appreciated!

The script.Parent Is a Union.

local Player = game.Players.LocalPlayer

local PreventSpam = false

script.Parent.ClickDetector.MouseClick:connect(function()
	if script.Parent:IsA("BasePart") then
		if PreventSpam == false then
		PreventSpam = true
		local Quest_Name = "QUEST02"
		if Player:FindFirstChild(Quest_Name) ~= nil then
			if Player ~= nil then
				script.Parent.BrickColor = BrickColor.new("Really Black")
				Quest_Name.Number.Value = Quest_Name.Number.Value + 1
				wait(5)
				PreventSpam = false
				script.Parent.BrickColor = BrickColor.new("Really Red")
			end
		else
			print(Player.Name .. " Has Yet To Start: " .. Quest_Name .. " " .. script.Parent.Name .. " Not Affected.")
		end
		end
	end
end)

1 comment

0

Maybe one of your if statements is returning false. Is it possible that it can't find Quest_Name in the Player?

1 answer

I'm not great at scripting, but the first thing I see, if how you spelled "Really Black". It should "Really black". The second word needs to be lower cased. Same goes for "Really Red". Should be "Really red". Colors need to be precisely spelled. Other than that, I'm not quite sure. It'd be better, if you could specify the path you used in

Quest_Name.Number.Value = Quest_Name.Number.Value + 1

I'm not sure what the "Number part" is. If this helped, please accept my answer :D

2 comments

0

The Number part is what the Value is called.

0

Well, I truly apologize, but I'm not sure why that doesn't work. Also, you should check if the union's "UsePartColor" in the properties section is set to true, otherwise it won't change.

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