Making an intro

Okay so im trying to make an intro for ym game that types for you, it work and everything but it replays whenever the player dies which is not something i’d want and it can get annoying.

i’ve tried destroying it after it runs but it runs right back which yeah
i’ve tried making it only run when the player joins but that for some reason also doesn’t wanna work

local function typewrite(textlabel, text, sound)
    sound:Play()

    for i = 1, #text do
        textlabel.Text = string.sub(text, 1, i)
        task.wait(0.05)
    end

    sound:Stop()
end

task.wait(1.5)

local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9058815929"
sound.Parent = script.Parent

local player = game.Players.LocalPlayer

local function onCharacterAdded(character)
    typewrite(script.Parent.Frame.TextLabel, "Turn the volume all the way up for the best experience", sound)

    task.wait(3)

    script.Parent.Enabled = false
    task.wait(2)

    script.Parent:Destroy()
end
1 Like

Okay so i found the fix, kinda.

Instead i kept this script as for how it is and removed the played added and Destroy() and instead made a server script that clones it into the player and then removes it

1 Like

That’s overkill. Just disable ScreenGui.ResetOnSpawn

1 Like

how did i not think of this ooh my loooordd :sob:

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