i was trying to make a cooldown on clicking for my clicker game, everything works properly except this script, on 11th line:
CooldownBar.BackgroundColor3 = Color3.FromRGB(85,170,255)
it outputs that i am attempting to call a nil value, if anybody knows please hit me up
local btn = script.Parent
local player = game.Players.LocalPlayer
local cooldown = false
local cooldownTime = 0.5
local CooldownBar = script.Parent.Parent.Cooldown
local CooldownText = script.Parent.Parent.CooldownText
btn.MouseButton1Click:Connect(function()
if cooldown == false then
CooldownBar.BackgroundColor3 = Color3.FromRGB(85,170,255)
CooldownText.Text = “Cooldown.”
cooldown = true
wait(cooldownTime)
CooldownBar.BackgroundColor3 = Color3.FromRGB(0,170,0)
CooldownText.Text = “Ready!”
cooldown = false
else
end
end)