Im currently trying to make a capture point have a countdown but im unsure how to do so to where if the player leaves the hitbox then the countdown resets ive attempted this:
TimerNum = TimerNum - 1
wait(1)
display.text = TimerNum
but it didnt work out right. (ps im using display as a placeholder for a billboard ui)
heres my full code:
local Hitbox = script.Parent
local TeamN = script.Parent.Values.TeamName
function onTouch(hit)
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
if user ~= nil then
script.Parent.TPLoc.BrickColor = user.TeamColor
TeamN.Value = user.Team.Name
script.Parent.TPLoc.Position = script.Parent.Values.TPPos.Value
end
end
script.Parent.Touched:connect(onTouch)