Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

While wait for remote function?

Asked by
Vezious 310 Moderation Voter
9 years ago

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

Log in to vote
0
Answered by 9 years ago

InvokeServer yields until the Server returns.

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

Ad

Answer this question