Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I disable a typewriting GUI when its finished being presented?

Long story short, I can't figure out how to get rid of the GUI when the typewriting is done being presented to the player.

My attempt to disable it is ,"local Parent.Enabled = false" but the . has the syntax error line under it.

local TextLabel = script.Parent:WaitForChild("Main"):WaitForChild("Text")

wait(1)

local function typewrite(object,text,length)
	for i = 1, #text, 1 do
		object.Text = string.sub(text,1,i)
		wait(0.02)
	end
end

typewrite(TextLabel,"Welcome to Car Factory Tycoon!",0.02)
wait(2)
typewrite(TextLabel,"Claim a Tycoon to begin!",0.05)
wait(2)

local Parent.Enabled = false

1 answer

✓ Accepted answer

This is because your attempt is using Parent.Enabled as a variable. When you put local Parent.Enabled, the code assumes you want to assign the Parent variable a value. To disable, you remove local. Just do

Parent.Enabled = false

This discussion is preserved as it was. New answers, comments, and votes are closed.