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
There is this keyword called return that can prematurely end a function and return a value
ok but how can i continously test for something to happen that would trigger that
Depends.please put the full code
i fixed it myself