Gui color changing not working

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)

3 Likes

It should be .fromRGB and not .FromRGB

1 Like

yooo thank you, i hate how minor misspellings can ruin the entire thing

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.