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?

4 comments

0

There is this keyword called return that can prematurely end a function and return a value

0

ok but how can i continously test for something to happen that would trigger that

0

Depends.please put the full code

0

i fixed it myself