I’m trying to make a script that waits until a certain function fires. Is this possible?
Example of what i’m talking about:
repeat wait() until ManualTrigger:Connect()
Part = Instance.new("Part")
Part.Parent = game.Workspace
ManualTrigger = game.ReplicatedStorage.ManualTrigger.OnServerEvent:Connect(function()
print("Fired")
end)
OR
spawn(function()
while true do
wait()
if ManualTrigger:Connect() then
print("ManualTrigger fired.")
end
end
end)
ManualTrigger = game.ReplicatedStorage.ManualTrigger.OnServerEvent:Connect(function()
print("Fired")
end)
All help is appreciated.