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

How can i make an event fire but stop the function if something else happens?

Asked by 6 years ago

i have an event that starts but i want it to have a possibility of stopping at any time how can i do that heres what i mean

game.ReplicatedStorage.Events.StartedMining.OnClientEvent:Connect(function()
--lots of stuff here



end)

how can i make the code stop at any time?

0
There is this keyword called return that can prematurely end a function and return a value User#19524 175 — 6y
0
ok but how can i continously test for something to happen that would trigger that mattchew1010 396 — 6y
0
Depends.please put the full code User#19524 175 — 6y
0
i fixed it myself mattchew1010 396 — 6y

Answer this question