Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

While wait for remote function?

I'm making a automatic Barista. The Client Picks a snack, The snack is sent to the main local script through BindableEvent. Then The Local scripts checks if the barista is free or not.

local Events = game.ReplicatedStorage.Events
local IsWaiting = false
Events.SendSnackClicked.Event:connect(function(Coordinates)
if IsWaiting == false then
IsWaiting = true
Events.SnackToServer:InvokeServer(Coordinates)
end
end)

But I want to make a custom wait Gui, which I haven't made. But lets say its -

function CustomWait()
script.Parent.Text =" Please Wait"
end

how do I make it so the script is something like

repeat
CustomWait()
until It's returned

1 answer

✓ Accepted answer

InvokeServer yields until the Server returns.

So, the answer is simple. Make the GUI appear before making the request, and hide it after InvokeServer.

This discussion is preserved as it was. New answers, comments, and votes are closed.