Char:WaitForChild("Humanoid").Died:Connect(function()
task.spawn(MuteAllAudio)
local lPlayer = game.Players.LocalPlayer
local Character = lPlayer.Character
local Results = script.Parent.Results
local Stuff = Character.Stuff
if Character:FindFirstChild("PickleName") then
local PickleName = Character:FindFirstChild("PickleName")
script.Parent.B.TextLabel.Text = "KILLED BY: "..PickleName.Value
end
game.TweenService:Create(script.Parent.B, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Position = UDim2.new(0, 0, 0.847, 0)}):Play()
game.TweenService:Create(script.Parent.T, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Position = UDim2.new(0, 0, 0, 0)}):Play()
local Run = function()
Results.PicklesCollected.Visible = true
task.wait(1)
local Check = CheckRating(Stuff.PickleCoinsCollected.Value, "PC")
Results.Sounds[Check]:Play()
Results.PicklesCollected:FindFirstChild(Check).Visible = true
task.wait(1)
Results.PicklesDodged.Visible = true
task.wait(1)
local Check = CheckRating(Stuff.PickleDodges.Value, "PD")
Results.Sounds[Check]:Play()
Results.PicklesDodged:FindFirstChild(Check).Visible = true
task.wait(1)
Results.Time.Visible = true
task.wait(1)
local Check = CheckRating(Stuff.TimeSurvived.Value, "TS")
Results.Sounds[Check]:Play()
Results.Time:FindFirstChild(Check).Visible = true
end
local Coru = coroutine.create(Run())
task.wait(5)
script.Parent.Door.Close:Play()
game.TweenService:Create(script.Parent.Door, TweenInfo.new(1.5, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {Position = UDim2.new(0, 0, 0, 0)}):Play()
task.wait(2)
script.Parent.Results.Visible = true
task.wait(0.5)
script.Parent.Music:Play()
script.Parent.Door.Close:Play()
game.TweenService:Create(script.Parent.Door, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {Position = UDim2.new(0, 0, -1, 0)}):Play()
task.wait(2)
Results.PicklesCollected.Text = tostring(Stuff.PickleCoinsCollected.Value).." Pickles collected."
--script.Parent.Results.PicklesDodged.Visible = true
Results.Time.Text = tostring(Stuff.TimeSurvived.Value).." Survived."
script.Parent.Results.Skip.MouseButton1Down:Connect(function()
print("ag")
coroutine.close(Coru)
Results.PicklesCollected.Visible = true
local Check = CheckRating(Stuff.PickleCoinsCollected.Value, "PC")
Results.PicklesCollected:FindFirstChild(Check).Visible = true
Results.PicklesDodged.Visible = true
local Check = CheckRating(Stuff.PickleDodges.Value, "PD")
Results.PicklesDodged:FindFirstChild(Check).Visible = true
Results.Time.Visible = true
local Check = CheckRating(Stuff.TimeSurvived.Value, "TS")
Results.Time:FindFirstChild(Check).Visible = true
end)
coroutine.resume(Coru)
end)
I tried to make an end results screen (Run() function) that you can skip, i thought using a corutine to cancel the reveal sequence and just put all the results on screen. Issue is that the skip button isint even printing at all. And im not sure if im even doing the corutine stuff right either as ive never done it.
Also you can ignore everything above the run function as that all works fine.
