Attempt to call an Instance Value?

Hello! I am confused with the error “attempt to call an instance value”.

Script:

local timer = game.Workspace.Values.Timer
timer.Value = 121
local function Timer()
	timer.Value = timer.Value - 1
end
repeat wait(1)
	timer()
until
timer.Value == 0

Hope you figured, but I’m doing a timer script and a continuation of my Time Resetting Problem.
Care to help? Thanks!

Inside of the repeat function your timer isn’t capitalized, replace it with Timer(); or rename the function to reduce confusion.

local timer = game.Workspace.Values.Timer
timer.Value = 121
local function Timer()
	timer.Value = timer.Value - 1
end
repeat wait(1)
	Timer()
until
timer.Value == 0

You were trying to call the Timer Instance and not the Timer function.

1 Like

Thanks! I am sorry as if I acted dumb I just did a typo lol. Thanks again!

1 Like

Thank you too but Xitral said it first so I have to give him the solution mark!

1 Like