Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you end an IntroGui, or better, a LocalScript regarding it?

Asked by 5 years ago

When I created my intro, adding what I want and little details and such, the Intro Gui doesn't seem to end. So now all I have is a white screen after the intro's done. I tried ending the script with "end" but that didn't work. Also, I'm an amateur, I know not much of scripting.

Here's a copy and paste of the LocalScript. If anyone knows what's wrong, please tell me. Or you don't have to, I'm not forcing anyone.. But help would be nice :)

local ReplicatedStorage = game:GetService("ReplicatedStorage")


local TypeWriter = require(ReplicatedStorage:WaitForChild("TypeWriter"))

wait (5)
TypeWriter.typeWrite(script.Parent, "...")
wait (5)
TypeWriter.typeWrite(script.Parent, "He's dead.")
wait (9)
TypeWriter.typeWrite(script.Parent, "...")
wait (3)
TypeWriter.typeWrite(script.Parent, "I don't believe them, not one bit.")
wait (3)
TypeWriter.typeWrite(script.Parent, "I bet he's out there, waiting for me.")
wait (9)
TypeWriter.typeWrite(script.Parent, "...")
wait (3)
TypeWriter.typeWrite(script.Parent, "I'm going to find him.")
wait (3)
TypeWriter.typeWrite (script.Parent, "Will you help me?")
wait (9)

local textLabel = script.Parent

local function fadeOut()
    for i = textLabel.TextTransparency, 1, .1 do
        wait(.1)
        textLabel.TextTransparency = i
    end
end

local function fadeIn()
    for i = textLabel.TextTransparency, 0, -.1 do
        wait(.1)
        textLabel.TextTransparency = i
    end
end

local lastIndex
while true do

    fadeOut()


    local index 
    repeat
        index = math.random(1, #content)
    until lastIndex ~= index

    lastIndex = index


    textLabel.Text = content[index]
    fadeIn()

end
0
You can always disable the script, which is a property of local and server scripts, using script.Disabled = true. This will completely shut down the script so it can't do anything. I'm not sure if this is what you were looking for, but I hope it can help you. Sulu710 142 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

you can set the Gui's "Enabled" property to false at the end of the script using

-- i'm assuming your Gui is the script.parent, reference it however though
script.Parent.Enabled = false
Ad
Log in to vote
0
Answered by 5 years ago

You can use break before the last end.

Answer this question