script.Parent.ProximityPrompt.Triggered:Connect(function()
--code
end)
--If cancel is == true then, stop the function above if it is mid-execution.
heartbeatrunservice:Connect(function()
if cancel == true then
proxPromptFunction:Stop()
end
end)
script.Parent.ProximityPrompt.Triggered:Connect(function()
--code
end)
--If cancel is == true then, stop the function above if it is mid-execution.
heartbeatrunservice:Connect(function()
if cancel == true then
proxPromptFunction:Disconnect()
end
end)
local cancel = false
local MyFunction = script.Parent.Triggered:Connect(function()
warn("hi")
end
heartbeatrunservice:Connect(function()
if cancel == true then
MyFunction:Disconnect()
end
end)