Hello. I want to make a clock to position right below a character and follow it around for 5 seconds before disappearing. When the remote event fires, the clock appears for probably 0.05 seconds before just disappearing. Nothing errors, nothing in the script destroys the clock at any time, it doesn’t even show up in the workspace in the explorer, and it just makes no sense.
abilities.TimeBomb.OnServerEvent:Connect(function(player)
--This is the part that actually matters.
local clockCircle = script.Clock:Clone()
clockCircle.Position = Vector3.new(player.Character:FindFirstChild("HumanoidRootPart").Position.X, 1, player.Character:FindFirstChild("HumanoidRootPart").Position.Z)
clockCircle.Parent = workspace
--abilities.TimeBomb:FireClient(player)
local targetPlayer = findNearestPlayer(player)
local timeGUI = script.TimerGUI:Clone()
timeGUI.Parent = targetPlayer.Character:FindFirstChild("Head")
timeGUI.Adornee = targetPlayer.Character:FindFirstChild("Head")
tweenService:Create(timeGUI.Timer, tweenInfo, {TextTransparency = 0}):Play()
local targetKills = targetPlayer.Assets.Kills.Value
for a = 5, 1, -1 do
if targetPlayer.Assets.Kills.Value > targetKills then
tweenService:Create(timeGUI.Timer, tweenInfo, {TextColor3 = Color3.fromRGB(44, 219, 31)}):Play()
timeGUI.Timer.Text = "---"
wait(0.25)
timeGUI:Destroy()
break
end
tweenService:Create(timeGUI.Timer, tweenInfo, {TextColor3 = Color3.fromRGB(219, 31, 44)}):Play()
wait(0.05)
timeGUI.Timer.Text = "🕒 "..a
wait(0.6)
tweenService:Create(timeGUI.Timer, tweenInfo, {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
wait(0.35)
end
--Damage
local targetHumanoid = targetPlayer.Character:FindFirstChildOfClass("Humanoid")
damageTarget(targetHumanoid.MaxHealth*3/5, player, targetPlayer)
--clockCircle:Destroy()
timeGUI:Destroy()
targetPlayer.Assets.Status.Value = "Stunned"
wait(1)
targetPlayer.Assets.Status.Value = "Neutral"