Hi guys, A bit of help is needed here.
I have a script that uses RemoteFunctions. Everything works on the server side, and most of it on the client side. The problem i have is that I have a for loop in the client script that isnt running. It did work at some point but it no longer does. The script works fine, but it just skips the for loop, and its something I really need to have working. Please see the code below. any help would be appreciated!
This is the for loop
for i = 1,120,-1 do
script.Parent.Submit.Text = "YOU MUST WAIT "..i.." SECONDS"
wait(1)
end
This is the script which the for loop is in.
debounce = false
script.Parent.Submit.MouseButton1Click:connect(function()
if debounce == false then
debounce = true
script.Parent.Submit.Text = "SENDING. PLASE WAIT..."
local reportedplr = script.Parent.ReportPlayer.Text
local details = script.Parent.ReportReason.Text
local API_Sender = game.ReplicatedStorage.ReportAPI_Config.DiscordReportAPI
local result = API_Sender:InvokeServer(reportedplr,details)
if result == "ok" then
script.Parent.Submit.Text = "SENT!"
else
script.Parent.Submit.Text = "ERROR SENDING REPORT, TRY AGAIN"
print(result)
end
wait(5)
for i = 1,120,-1 do
script.Parent.Submit.Text = "YOU MUST WAIT "..i.." SECONDS"
wait(1)
end
script.Parent.Submit.Text = "SUBMIT"
debounce = false
end
end)

2 comments
brilliant, it works now. No idea how I managed to make such a rookie mistake like this. thanks!!!
Haha, no problem.