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

i need help with 2 text labels do you think you can help me?

i'm making a story game and i want to make 2 text labels visible and after a few word its not, with a script in ServerScriptService this is my script so far game.StarterGui.MainGui.Speaker.Visible = true game.StarterGui.MainGui.Text.Visible = true but it doesn't seem to work

1 comment

1

https://idownvotedbecau.se/NoEffort Google search exists. Use it

2 answers

hmm easy fix

local TextLabel = game.StarterGui.MainGui.Text
local Text
local Speaker = game.StarterGui.MainGui.Speaker

--just incase you didn't add one of these effects ima add it for you
function setText(word)
	Text = word
	for i= 1, #Text do
		textLabel.Text = string.sub(Text, 1, i)
		wait(0.04)
	end
end

while wait() do
	if TextLabel.Visible == true then
		wait(0.5)
		setText(" ") --fill in what they are meant to say in the (" ")
		TextLabel.Visible = false
	end
	break
end

wait(3)

TextLabel.Visible = true
Speaker.Visible = true

Hope this helps!

2 comments

0

The effect i added makes it look like someone is typing the words out live instead of all the words popping up at once.

1

did you even test it? i didn't test it and I already know it doesn't work >-<

Wrong, wrong, wrong. If you have FilteringEnabled, it won't work on a script. You have to use a LOCAL SCRIPT, INSIDE OF STARTERGUI. Use it like this: Local Script => StarterGui <= MainGui AND proceed like this:

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

-- functions
function setText(word)
    Text = word
    for i= 1, #Text do
        TextLabel.Text = string.sub(Text, 1, i)
        wait(0.04)
    end
end

while wait() do
    if TextLabel.Visible == true then
        wait(0.5)
        setText(" ") --fill in what they are meant to say in the (" ")
        TextLabel.Visible = false
    end
    break
end

wait(3)

TextLabel.Visible = true
Speaker.Visible = true

Copied from one answer BUT fixed.

3 comments

0

what is FilteringEnabled?

0

something to prevent exploiters from hacking and affecting everything.

0

something to prevent exploiters from hacking and affecting everything.

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