Hey Robloxians!
I am using Form Embedder by @BitwiseAndrea, but I have a problem. When trying to use the ‘ToggleForm’ bindable function it gives me the following error:
Script that implemented this callback has been destroyed while calling async callback - Client - PopUpScript:29
This is the script I’m using:
local revive = game:GetService('ReplicatedStorage').Revive
local button = script.Parent
local loadingbar = button.LoadingBar
local toggleform = button.Parent.Parent:WaitForChild("FormGui").ToggleForm
local tweenservice = game:GetService('TweenService')
local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false , 0)
local music = game:GetService('SoundService').BackgroundMusic
local tickingclock = game:GetService('SoundService').TickingClock
revive.OnClientEvent:Connect(function()
tickingclock.TimePosition = 0
music.Playing = false
tickingclock.Playing = true
loadingbar.Size = UDim2.new(0, 0, 0.25, 0)
button.Visible = true
local tween = tweenservice:Create(loadingbar, tweeninfo, {Size = UDim2.new(1, 0, 0.25, 0)})
tween:Play()
wait(3)
if button.Visible == true and tickingclock.Playing == true then
revive:FireServer(false)
tickingclock.Playing = false
button.Visible = false
end
end)
button.MouseButton1Click:Connect(function()
tickingclock.Playing = false
button.Visible = false
toggleform:Invoke('1FAIpQLSeZ_N6WrggnpNhC4irTWQVcZjlPkxTbhM3GQ_jZ57iTPhFVIA')
end)
Any help would be appreciated!
Kind regards, iamajust