My Script ReActivates After I Die/Reset

I’m trying to make an intro game gui by using TweenService. Like, tweening a big frame the covers all the screen (the idea of the game intro).

The problem is that when I die/reset, it re-does the tween again..

I tried to fix it at first, but it was too impossible for my megaminded brain. Also asking AI didn’t work

This is the script:

local Player = game.Players.LocalPlayer
local PlayerGui = Player.PlayerGui
local Gui = PlayerGui:WaitForChild("LoadingScreenGui")
local Frame = Gui.Frame

local TweenService = game.TweenService
local Info = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 1)
-- Frame is invisible at first
Frame.Visible = true
TweenService:Create(Frame, Info, {BackgroundTransparency = 1}):Play()

Best,
XMLcard

ScreenGui objects have a property defaulted on which basically deletes and recopies the entire gui back in when you die. Uncheck that and you won’t have to script around it since it will just keep it in playergui.

The property
https://create.roblox.com/docs/reference/engine/classes/ScreenGui#ResetOnSpawn

2 Likes

Thank you, professor Einstein :smile:

1 Like

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