Hello, I made a Fade Wrapper in a ModuleScript which you only do Fade.FadeIn(Player) then it fades in.
But I want it to teleport the player when the fade is done. Now as I am calling it from another script using a ModuleScript and require how would I yield until the fade is done.
I could not find one, just about remoteevents etc.
Current Script:
if Map["Spawns"]:FindFirstChild(Spawn)
then
local TempFade = FadeService.FadeIn(Player)
-- Wait until fade is done and continue
ModuleScript:
local M = {}
function M.FadeOut(Player)
local Gui = Player.PlayerGui:FindFirstChild("Fade")
local Frame = Gui.Frame
for i = 0,1,0.1 do
Frame.BackgroundTransparency = i
wait(0.01)
end
end
function M.FadeIn(Player)
local Gui = Player.PlayerGui:FindFirstChild("Fade")
local Frame = Gui.Frame
for i = 1,0,0.1 do
Frame.BackgroundTransparency = i
wait(0.01)
end
end
return M
Thanks in advance.