I have a .Died event for a humanoid that is meant to reset some active effects and player’s status conditions. However, sometimes, only a little bit of the script works, but not the rest, and I have no clue as to why.
The Died event, part of a much bigger script.
local humanoid = localPlayer.Character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
print("1")
status = "Normal"
print("2")
condition = "Healed"
print("3")
music.PlaybackSpeed = 1
print("4")
tweenNormal:Play()
tweenNormalBright:Play()
tweenBlurNormal:Play()
local root = localPlayer.Character:FindFirstChild("HumanoidRootPart")
if root then
root.PoisonParticle.Enabled = false
root.BurnFire.Enabled = false
end
localPlayer.CameraMode = Enum.CameraMode.Classic
localPlayer.CameraMinZoomDistance = 15
localPlayer.CameraMinZoomDistance = .5
tweenCameraOut:Pause()
local tweenCameraIn = tweenService:Create(camera, tweenInfo, {FieldOfView = 70})
tweenCameraIn:Play()
end)
The entire and very long script, it is very irrelevant to the issue.
local parts = game.Workspace:GetDescendants()
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local dataEvent = game.ReplicatedStorage.DataSave
local music = game.Workspace.Music
local cc = game.Lighting.ColorCorrection
local blur = game.Lighting.Blur
local sounds = game.SoundService.SoundEffects
local ticking = sounds.Ticking
local ding = sounds.Ding
local poison = sounds.Poison
local heal = sounds.Heal
local blurSound = sounds.Blur
local switch = sounds.Switch
local blind = sounds.Blind
local burn = sounds.Burn
local cameraLock = sounds.CameraLock
local status = "Normal"
local condition = ""
local hyperDebounce = false
local normalDebounce = true
local tiredDebounce = false
local deadDebounce = false
local checkDebounce = false
local stopDebounce = false
local poisonDebounce = false
local bounceDebounce = false
local healDebounce = true
local antidoteDebounce = true
local semiDebounce = false
local quarterDebounce = false
local randomKillDebounce = false
local pushDebounce = false
local blurDebounce = false
local tempDebounce = false
local carryDebounce = false
local blindDebounce = false
local burnDebounce = false
local redSwitchDebounce = true
local blueSwitchDebounce = false
local firstPersonDebounce = false
local barrierDebounce = false
local camZoomDebounce = false
local camera = game.Workspace.CurrentCamera
local heartbeat = game:GetService("RunService").Heartbeat
local tweenService = game:GetService("TweenService")
local char = localPlayer.Character or localPlayer.CharacterAdded:Wait()
local tweenInfo = TweenInfo.new(
.15,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local tweenInfoSpawn = TweenInfo.new(
.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local tweenTempInfo = TweenInfo.new(
5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local tweenTempSwitchInfo = TweenInfo.new(
.25,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local tweenCamInfo = TweenInfo.new(
2.5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
true,
0
)
local tweenHyper = tweenService:Create(cc, tweenInfo, {TintColor = Color3.fromRGB(224, 96, 255)})
local tweenHyperBright = tweenService:Create(cc, tweenInfo, {Brightness = .3})
local tweenNormal = tweenService:Create(cc, tweenInfo, {TintColor = Color3.fromRGB(255, 255, 255)})
local tweenNormalBright = tweenService:Create(cc, tweenInfo, {Brightness = 0})
local tweenTired = tweenService:Create(cc, tweenInfo, {TintColor = Color3.fromRGB(158, 176, 180)})
local tweenTiredBright = tweenService:Create(cc, tweenInfo, {Brightness = -.1})
local tweenStopper = tweenService:Create(cc, tweenInfo, {Saturation = -1})
local tweenUnstopper = tweenService:Create(cc, tweenInfo, {Saturation = 0})
local tweenPoison = tweenService:Create(cc, tweenInfo, {TintColor = Color3.fromRGB(102, 26, 255)})
local tweenBlur = tweenService:Create(blur, tweenInfo, {Size = 50})
local tweenBlurNormal = tweenService:Create(blur, tweenInfo, {Size = 0})
local tweenBlind = tweenService:Create(cc, tweenInfo, {Contrast = -1})
local tweenUnblind = tweenService:Create(cc, tweenInfo, {Contrast = 0})
local tweenCameraOut = tweenService:Create(camera, tweenCamInfo, {FieldOfView = 120})
for index, part in pairs(parts) do
if part:IsA("BasePart") or part:IsA("Model") then
if part.Name == "HyperPad" then
--Hyper pad
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not hyperDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
hyperDebounce = true
normalDebounce = false
tiredDebounce = false
status = "Hyper"
localPlayer.Character.Humanoid.WalkSpeed = 50
music.PlaybackSpeed = 1.5
tweenHyper:Play()
tweenHyperBright:Play()
end
end)
end
if part.Name == "NormalPad" then
--Normal pad
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not normalDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
normalDebounce = true
hyperDebounce = false
tiredDebounce = false
status = "Normal"
localPlayer.Character.Humanoid.WalkSpeed = 20
music.PlaybackSpeed = 1
tweenNormal:Play()
tweenNormalBright:Play()
end
end)
end
if part.Name == "TiredPad" then
--Tired pad
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not tiredDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
tiredDebounce = true
hyperDebounce = false
normalDebounce = false
status = "Tired"
localPlayer.Character.Humanoid.WalkSpeed = 13.5
music.PlaybackSpeed = .8
tweenTired:Play()
tweenTiredBright:Play()
end
end)
end
if part.Name == "KillPart" then
--Kill part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not deadDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
deadDebounce = true
tiredDebounce = false
hyperDebounce = false
normalDebounce = true
localPlayer.Character.Humanoid.WalkSpeed = 20
hit.Parent.Humanoid.Health = 0
wait(3.25)
deadDebounce = false
end
end)
end
if string.find(part.Name, "Checkpoint") then
--Checkpoint
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) then
if localPlayer.RespawnLocation ~= part and part.BrickColor == BrickColor.new("Persimmon") and tonumber(string.sub(part.Name, 11)) == localPlayer:WaitForChild("hleaderstats").Level.Value + 1 and not checkDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
checkDebounce = true
stopDebounce = false
localPlayer.RespawnLocation = part
dataEvent:FireServer()
part.BrickColor = BrickColor.new("Electric blue")
part.red_flag1.Transparency = 0
part.blue_flag1.Transparency = 1
game.SoundService.SoundEffects.Checkpoint:Play()
wait(.25)
checkDebounce = false
end
end
end)
end
if part.Name == "Stopper" then
--Stopper
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not stopDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
stopDebounce = true
localPlayer.Character.HumanoidRootPart.Anchored = true
music:Pause()
tweenStopper:Play()
tweenNormalBright:Play()
tweenNormal:Play()
ticking:Play()
wait(4.2)
ticking:Stop()
wait(.05)
ding:Play()
wait(.5)
music:Resume()
tweenUnstopper:Play()
if status == "Hyper" then
tweenHyper:Play()
tweenHyperBright:Play()
elseif status == "Normal" then
tweenNormalBright:Play()
tweenNormal:Play()
elseif status == "Tired" then
tweenTired:Play()
tweenTiredBright:Play()
end
localPlayer.Character.HumanoidRootPart.Anchored = false
end
end)
end
if part.Name == "PoisonPart" then
--Poison part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not poisonDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
poisonDebounce = true
healDebounce = false
antidoteDebounce = false
condition = ""
poison:Play()
tweenPoison:Play()
tweenHyperBright:Play()
localPlayer.Character.HumanoidRootPart.PoisonParticle.Enabled = true
wait(.25)
if status == "Hyper" then
tweenHyperBright:Play()
tweenHyper:Play()
elseif status == "Normal" then
tweenNormalBright:Play()
tweenNormal:Play()
elseif status == "Tired" then
tweenTired:Play()
tweenTiredBright:Play()
end
for count = 1, 50 do
if condition == "Healed" then
break
end
if hit.Parent then
localPlayer.Character.Humanoid.Health = hit.Parent.Humanoid.Health - 2
end
wait(.4)
end
end
end)
end
if part.Name == "BurnPart" then
--Burn part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not burnDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
burnDebounce = true
healDebounce = false
antidoteDebounce = false
condition = ""
localPlayer.Character.HumanoidRootPart.BurnFire.Enabled = true
burn:Play()
for count = 1, 20 do
if condition == "Healed" then
break
end
if hit.Parent then
localPlayer.Character.Humanoid.Health = hit.Parent.Humanoid.Health - 5
end
wait(1.25)
end
end
end)
end
if part.Name == "HealPart" then
--Heal part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not healDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
healDebounce = true
antidoteDebounce = true
poisonDebounce = false
burnDebounce = false
condition = "Healed"
heal:Play()
localPlayer.Character.HumanoidRootPart.PoisonParticle.Enabled = false
localPlayer.Character.HumanoidRootPart.HealParticle.Enabled = true
localPlayer.Character.HumanoidRootPart.BurnFire.Enabled = false
localPlayer.Character.Humanoid.Health = 100
wait(.75)
localPlayer.Character.HumanoidRootPart.HealParticle.Enabled = false
end
end)
end
if part.Name == "AntidotePart" then
--Antidote part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not antidoteDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
antidoteDebounce = true
poisonDebounce = false
burnDebounce = false
condition = "Healed"
heal:Play()
localPlayer.Character.HumanoidRootPart.PoisonParticle.Enabled = false
localPlayer.Character.HumanoidRootPart.HealParticle.Enabled = true
localPlayer.Character.HumanoidRootPart.BurnFire.Enabled = false
wait(.75)
localPlayer.Character.HumanoidRootPart.HealParticle.Enabled = false
end
end)
end
if part.Name == "BouncePart" then
--Bounce part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not bounceDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
bounceDebounce = true
hit.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
wait(.1)
bounceDebounce = false
end
end)
end
if part.Name == "SemiKillPart" then
--Semi kill part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not semiDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
semiDebounce = true
local tweenBlack = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(137, 127, 121)})
local tweenOrange = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(243, 111, 45)})
localPlayer.Character.Humanoid.Health = localPlayer.Character.Humanoid.Health - 50
healDebounce = false
tweenBlack:Play()
wait(2)
tweenOrange:Play()
wait(.2)
semiDebounce = false
end
end)
end
if part.Name == "QuarterKillPart" then
--Quarter kill part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not quarterDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
quarterDebounce = true
local tweenBlack = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(137, 127, 121)})
local tweenOrange = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(58, 125, 21)})
localPlayer.Character.Humanoid.Health = localPlayer.Character.Humanoid.Health - 25
healDebounce = false
tweenBlack:Play()
wait(2)
tweenOrange:Play()
wait(.2)
quarterDebounce = false
end
end)
end
if part.Name == "RandomKillPart" then
--Random kill part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not randomKillDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
randomKillDebounce = true
local tweenBlack = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(137, 127, 121)})
local tweenOrange = tweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(13, 105, 172)})
local randomDamage = math.random(1, 100)
localPlayer.Character.Humanoid.Health = localPlayer.Character.Humanoid.Health - randomDamage
healDebounce = false
tweenBlack:Play()
wait(2)
tweenOrange:Play()
wait(.2)
randomKillDebounce = false
end
end)
end
if part.Name == "BlurPart" then
--Blur part
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not blurDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
blurDebounce = true
blurSound:Play()
tweenBlur:Play()
wait(5)
tweenBlurNormal:Play()
wait(.25)
blurDebounce = false
end
end)
end
if part.Name == "TempPlatformPart" then
--Temp part
local startPlatforms = part:GetChildren()
for index, startPlatform in pairs(startPlatforms) do
startPlatform.Transparency = 1
startPlatform.CanCollide = false
end
local tweenWhite = tweenService:Create(part, tweenTempSwitchInfo, {Color = Color3.fromRGB(255, 255, 255)})
local tweenBlack = tweenService:Create(part, tweenTempSwitchInfo, {Color = Color3.fromRGB(0, 0, 0)})
part.Touched:Connect(function(hit)
local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player == localPlayer) and not tempDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
tempDebounce = true
local platforms = part:GetChildren()
tweenBlack:Play()
switch:Play()
for index, platform in pairs(platforms) do
if platform:IsA("BasePart") then
local tweenTempFade = tweenService:Create(platform, tweenTempInfo, {Transparency = 1})
platform.Transparency = 0
platform.CanCollide = true
tweenTempFade:Play()
end
end
wait(5)
for index, platform in pairs(platforms) do
if platform:IsA("BasePart") then
platform.CanCollide = false
end
end
tweenWhite:Play()
wait(.2)
tempDebounce = false
end
end)
end
if part.Name == "PlayerCarrier" then
--Player carrier
part:WaitForChild("PlayerCarry").Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player == localPlayer and not carryDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
carryDebounce = true
local bodyPos = Instance.new("BodyPosition")
bodyPos.MaxForce = Vector3.new(9999999999, 999999999, 999999999)
bodyPos.P = 20000
bodyPos.D = 1250
bodyPos.Parent = hit.Parent.HumanoidRootPart
bodyPos.Position = part.CarryDestination.Position
wait(1)
bodyPos:Destroy()
carryDebounce = false
end
end)
end
if part.Name == "BlindPart" then
--Blind part
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player == localPlayer and not blindDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
blindDebounce = true
blind:Play()
tweenBlind:Play()
wait(1)
tweenUnblind:Play()
wait(.2)
blindDebounce = false
end
end)
end
if part.Name == "RedSwitch" then
--Red switch
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player == localPlayer and not redSwitchDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
redSwitchDebounce = true
blueSwitchDebounce = false
switch:Play()
for index, platform in pairs(parts) do
if platform:IsA("BasePart") then
if platform.Name == "RedSwitch" then
local tweenSwitchFade = tweenService:Create(platform, tweenInfo, {Transparency = .75})
tweenSwitchFade:Play()
elseif platform.Name == "BlueSwitch" then
local tweenSwitchFade = tweenService:Create(platform, tweenInfo, {Transparency = 0})
tweenSwitchFade:Play()
elseif platform.Name == "RedSwitchPlatform" then
platform.CanCollide = true
local tweenPlatformFade = tweenService:Create(platform, tweenInfo, {Transparency = 0})
tweenPlatformFade:Play()
elseif platform.Name == "BlueSwitchPlatform" then
platform.CanCollide = false
local tweenPlatformFade = tweenService:Create(platform, tweenInfo, {Transparency = .6})
tweenPlatformFade:Play()
end
end
end
end
end)
end
if part.Name == "BlueSwitch" then
--Blue switch
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player == localPlayer and not blueSwitchDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
blueSwitchDebounce = true
redSwitchDebounce = false
switch:Play()
for index, platform in pairs(parts) do
if platform:IsA("BasePart") then
if platform.Name == "RedSwitch" then
local tweenSwitchFade = tweenService:Create(platform, tweenInfo, {Transparency = 0})
tweenSwitchFade:Play()
elseif platform.Name == "BlueSwitch" then
local tweenSwitchFade = tweenService:Create(platform, tweenInfo, {Transparency = .75})
tweenSwitchFade:Play()
elseif platform.Name == "RedSwitchPlatform" then
platform.CanCollide = false
local tweenPlatformFade = tweenService:Create(platform, tweenInfo, {Transparency = .6})
tweenPlatformFade:Play()
elseif platform.Name == "BlueSwitchPlatform" then
platform.CanCollide = true
local tweenPlatformFade = tweenService:Create(platform, tweenInfo, {Transparency = 0})
tweenPlatformFade:Play()
end
end
end
end
end)
end
if part.Name == "FirstPersonPart" then
--First person part
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player == localPlayer and not firstPersonDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
firstPersonDebounce = true
localPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
cameraLock:Play()
wait(4)
if localPlayer.Character.Humanoid.Health ~= 0 then
localPlayer.CameraMode = Enum.CameraMode.Classic
localPlayer.CameraMinZoomDistance = 15
localPlayer.CameraMinZoomDistance = .5
end
wait(.2)
firstPersonDebounce = false
end
end)
end
if part.Name == "CameraZoomPart" then
--First person part
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player == localPlayer and not camZoomDebounce and localPlayer.Character.Humanoid.Health ~= 0 then
camZoomDebounce = true
tweenCameraOut:Play()
wait(5.2)
camZoomDebounce = false
end
end)
end
end
end
--When player dies
localPlayer.CharacterAdded:Connect(function()
wait(.1)
tiredDebounce = false
hyperDebounce = false
normalDebounce = true
stopDebounce = false
poisonDebounce = false
burnDebounce = false
healDebounce = true
blurDebounce = false
redSwitchDebounce = true
blueSwitchDebounce = false
for index, platform in pairs(parts) do
if platform:IsA("BasePart") then
if platform.Name == "RedSwitch" then
local tweenSwitchFade = tweenService:Create(platform, tweenInfo, {Transparency = .75})
tweenSwitchFade:Play()
elseif platform.Name == "BlueSwitch" then
local tweenSwitchFade = tweenService:Create(platform, tweenInfo, {Transparency = 0})
tweenSwitchFade:Play()
elseif platform.Name == "RedSwitchPlatform" then
platform.CanCollide = true
local tweenPlatformFade = tweenService:Create(platform, tweenInfo, {Transparency = 0})
tweenPlatformFade:Play()
elseif platform.Name == "BlueSwitchPlatform" then
platform.CanCollide = false
local tweenPlatformFade = tweenService:Create(platform, tweenInfo, {Transparency = .6})
tweenPlatformFade:Play()
end
end
end
local rootPart = localPlayer.Character:WaitForChild("HumanoidRootPart")
rootPart.Anchored = false
if not localPlayer.RespawnLocation or localPlayer.RespawnLocation == game.Workspace.StartPoint1 then
localPlayer.Character:MoveTo(game.Workspace.StartPoint1.Position)
localPlayer.RespawnLocation = game.Workspace.StartPoint1
else
localPlayer.RespawnLocation.BrickColor = BrickColor.new("Electric blue")
localPlayer.RespawnLocation.red_flag1.Transparency = 0
localPlayer.RespawnLocation.blue_flag1.Transparency = 1
localPlayer.Character:MoveTo(localPlayer.RespawnLocation.Position)
end
rootPart.Anchored = true
local humanoid = localPlayer.Character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
print("1")
status = "Normal"
print("2")
condition = "Healed"
print("3")
music.PlaybackSpeed = 1
print("4")
tweenNormal:Play()
tweenNormalBright:Play()
tweenBlurNormal:Play()
local root = localPlayer.Character:FindFirstChild("HumanoidRootPart")
if root then
root.PoisonParticle.Enabled = false
root.BurnFire.Enabled = false
end
localPlayer.CameraMode = Enum.CameraMode.Classic
localPlayer.CameraMinZoomDistance = 15
localPlayer.CameraMinZoomDistance = .5
tweenCameraOut:Pause()
local tweenCameraIn = tweenService:Create(camera, tweenInfo, {FieldOfView = 70})
tweenCameraIn:Play()
end)
end)
In the Died event, I had put 4 print() statements to see what runs and what doesn’t, and the results are very odd.
The 2 lines before the print("3")
that aren’t print() statements run, but for some odd reason, nothing prints at all. There is nothing that would seem to interfere with it, as there is only one Died event in the game.
-
What do you want to achieve? I want to reset status conditions and effects when the player dies.
-
What is the issue? Only a couple lines run for some reason.
-
What solutions have you tried so far? I had tried searching for similar topics, but found nothing that could help.
To note, this is a LocalScript in StarterPlayerScripts. This only happens when I die for the first time. Every other time after that, it works correctly. This was already functioning correctly before I added the tweenCameraOut:Pause()
bit, but now it isn’t working.
It isn’t that it isn’t the same humanoid that dies every time. If this were the case, only the first time would work, and no other times, whereas only the first time doesn’t work, but every other time, it works.
Edit: After having the script ignore the tweenCameraOut:Pause()
part, the script still acted the same way.
Double edit: The bit of the script that I though was working turned out to not be working. It seems that the Died event isn’t even firing the first time.