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

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

Asked by
sameb556 -12
4 years ago
Edited 4 years ago

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
https://idownvotedbecau.se/NoEffort Google search exists. Use it User#30567 0 — 4y

Closed as Not Constructive by BestCreativeBoy, Dovydas1118, and imKirda

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 4 years ago

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!

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. MarcTheRubixQb 153 — 4y
1
did you even test it? i didn't test it and I already know it doesn't work >-< User#30567 0 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
what is FilteringEnabled? sameb556 -12 — 4y
0
something to prevent exploiters from hacking and affecting everything. krowten024nabrU 463 — 4y
0
something to prevent exploiters from hacking and affecting everything. krowten024nabrU 463 — 4y