Syntax error on ServerScriptService

After giving up since January, I gave scripting a new chance, and I tried making a function out of memory.

local definingTimes = 0



local function learningtoScript(times, waitTime)
    times = definingTimes
	repeat until times = 69 
	print("OP is so cool and attractive")
	wait(0.05)
	times = times + 1
end

learningtoScript()

Gave me a syntax error of "ServerScriptService.Script:7: Expected identifier when parsing expression, got ‘=’ "

What is wrong with my script and how can I optimize it, can you give me some good practices otw?

replace your = with == to check for equality

3 Likes

What’s the difference between = and ==?

“=” for set something
“==” for compare

1 Like

It’s giving me error ServerScriptService.Script:13: Script timeout: exhausted allowed execution time

repeat wait() until?

ignore this, its limit of 30

What does that change in the script?

Wait i’m so dumb sorry. I didn’t realize the repeat thing

Not sure how to explain… But I am pretty sure thats why it is timing out.

It will wait. If you do not wait, then it will not have a cooldown and it will run at godlike speeds, then eventually crash your studio, or something

1 Like

No the reason why is because my idiotic self didn’t put the code inside the lua repeat codehere until

I added the wait inside the function but thank you.