When the caller leaves the module stops the code entirely. For example, if I were to do this in a module
-- The script that calls the module
local Player = game.Players.LocalPlayer
local EnemyPlayer = workspace.EnemyPlayer
local Module = require(game.ReplicatedStorage.Module)
module.Call(EnemyPlayer)
--Module Call
EnemyPlayer.Humanoid:TakeDamage(20)
wait(20)
EnemyPlayer.Humanoid:TakeDamage(20)
If the Player were the one to call the module and leave between the wait time, the second damage wouldn't happen. How do I fix this?

1 comment
You could also use pcall(function() as that will keep the code running even if an error occurs.