Gui Script only works in studio and not in-game

For some reason, my GUI script only works when I launch it in studio and not when I try to go into the place, I have published the game.

Here’s the code.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local AnimationUi = require(ReplicatedStorage:WaitForChild("AnimateUi"))

local TweenService = game:GetService("TweenService")

local Players = game:GetService("Players").LocalPlayer
local PlayersGlobal = game:GetService("Players")
local ThingText = script.Parent.Frame.TextJoin
local ThingTextBottom = script.Parent.Frame.TextJoinBottom

local Background = script.Parent.Frame.Background

-- Tween Stuff

local TweenInfoText = TweenInfo.new(
	2,
	Enum.EasingStyle.Cubic,
	Enum.EasingDirection.InOut,
	0,
	false
)


-- Script
Players.CharacterAppearanceLoaded:Wait()
ThingTextBottom.TextTransparency = 1

local Text = "Welcome, " .. Players.Name
AnimationUi.typeWrite(ThingText, Text, 0.1)

local TextBottom = "You are ".. Players.AccountAge .. " days old."

ThingTextBottom.TextTransparency = 0
AnimationUi.typeWrite(ThingTextBottom, TextBottom, 0.1)

local TextTween = TweenService:Create(ThingText, TweenInfoText, {TextColor3 = Color3.fromRGB(41, 230, 101)})
local TextTweenBottom = TweenService:Create(ThingTextBottom, TweenInfoText, {TextColor3 = Color3.fromRGB(230, 209, 49)})

TextTween:Play()
TextTweenBottom:Play()

TextTweenBottom.Completed:Wait()

script.Parent:Destroy()

Nevermind, I solved it by removing

Players.CharacterAppearanceLoaded:Wait()