Am I doing something wrong with setting this connection? I know that something’s going wrong with the connection = funct() line because the last if statement doesn’t run.
local connection
local function func()
-- the stuff in here continues to run AFTER being disconnected
while wait(.1) do
remote:FireServer()
end
end
spawn(function()
connection = func()
end)
wait(3)
if connection ~= nil then
func:Disconnect()
end
local connection
local function call()
remote:FireServer()
end
spawn(function()
while wait() do
connection = func()
wait(3)
if connection ~= nil then
print("inactive")
break
end
end)