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
Maybe one of your if statements is returning false. Is it possible that it can't find Quest_Name in the Player?