Loading Screen Triggers on death

I have a loading screen a game im making which triggers a bunch of remote events when it finishes like starting cut scenes and stuff
the issue im having is that when the player dies, it plays the loading screen again and runs the remote events which play the cutscenes again which i dont want. Could somebody please help
here is the script

local Loadingscreen = script.Parent.Frame
local player = game.Players.LocalPlayer

game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

Loadingscreen.Visible = true

repeat wait() until player.Character ~= nil

game:GetService(“ContentProvider”):PreloadAsync({workspace, player.PlayerGui})

Loadingscreen.TextLabel.Text = “Loading Complete”
wait(1)

game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
script.Parent:Destroy()
game.ReplicatedStorage.Remotes.Loaded:FireServer(player)

Disable the ResetOnSpawn property of your ScreenGui.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.