For my game “The Great Era”, there is this system in place where players will receive what’s known as a “combat tag” if another player damages / attacks them so therefore if they are to leave, they will be punished more than dying in-game. However, I want to make a system in place where it will add more time instead of starting a thread that just waits a period and then changes a value. Any ideas?
What I am currently using
if game.Players:GetPlayerFromCharacter(Character) ~= nil then
local Player = game.Players:GetPlayerFromCharacter(Character)
if Player.Stats.InCombat.Value == false then
print("Combat tagged "..Player.Name.." For "..tostring(Duration).." seconds")
coroutine.resume(coroutine.create(function()
Player.Stats.InCombat.Value = true
wait(Duration)
Player.Stats.InCombat.Value = false
end))
end
end
end