Ad
Log in to vote
2

text label not changing?

Asked by 2 months ago

Ive tried doing the text label effect the regular way but it wasnt work, so i changed to this, the text label still wont change though no errors;

local plr = game.Players.LocalPlayer
if workspace.IntroductionValue.Value == 1 then
    print("(????)")
    script.Parent.TextStrokeTransparency = 0
    wait(0.1)
    script.Parent.Text = "H"
    wait(0.5)
    script.Parent.Text = "Hu"
    wait(0.5)
    script.Parent.Text = "Huh"
    wait(0.5)
    script.Parent.Text = "Huh."
    wait(0.5)
    script.Parent.Text = "Huh.."
    wait(0.5)
    script.Parent.Text = "Huh..?"
    wait(3)
    wait(0.5)
    script.Parent.Text = " "
    wait(0.5)
    script.Parent.Text = "W"
    wait(0.5)
    script.Parent.Text = "Wh"
    wait(0.5)
    script.Parent.Text = "Whe"
    wait(0.5)
    script.Parent.Text = "Wher"
    wait(0.5)
    script.Parent.Text = "Where"
    wait(0.5)
    script.Parent.Text = "Where "
    wait(0.5)
    script.Parent.Text = "Where a"
    wait(0.5)
    script.Parent.Text = "Where am"
    wait(0.5)
    script.Parent.Text = "Where am "
    wait(0.5)
    script.Parent.Text = "Where am I"
    wait(0.5)
    script.Parent.Text = "Where am I?"













end

2 answers

Log in to vote
1
Answered by 2 months ago

There is nothing activating the function.

Do the following. Create something that activates the function, such as a remoteEvent that, when triggered, does this.

So... Let's assume that the dialogue starts when the player touches a piece

To activate this RemoteEvent on the specific client, do the following.

local Debounce = false -- Is a lock.

script.Parent.Touched:Connect(function(Hit)
    if Debounce == false then
        Debounce = true

        local Character = Hit.Parent
        local Player = game.Players:GetPlayerFromCharacter(Character)
        if Player then
            script.Parent.RemoteEvent:FireClient(Player)
        end

    end
end)

In the LocalScript.

local DialoguePart = workspace:WaitForChild("DialoguePart")
local RemoteEvent = DialoguePart:WaitForChild("RemoteEvent")

RemoteEvent.OnClientEvent:Connect(function(Player)
    -- Your Code here. To make changes to the text.
end)

Hope this helps

Any questions, you can ask me

:)

0
Bruh Ziffixture 6785 — 2mo
Ad
Log in to vote
1
Answered by 2 months ago
Edited 2 months ago

Try seeing if it's because you're using an if statement when you should have something that checks more often (if statements only run once)

Try:

local plr = game.Players.LocalPlayer

workspace.IntroductionValue:GetPropertyChangedSignal("Value"):Connect(function()
    if workspace.IntroductionValue.Value == 1 then
        print("(????)")
        script.Parent.TextStrokeTransparency = 0
        wait(0.1)
        script.Parent.Text = "H"
        wait(0.5)
        script.Parent.Text = "Hu"
        wait(0.5)
        script.Parent.Text = "Huh"
        wait(0.5)
        script.Parent.Text = "Huh."
        wait(0.5)
        script.Parent.Text = "Huh.."
        wait(0.5)
        script.Parent.Text = "Huh..?"
        wait(3)
        wait(0.5)
        script.Parent.Text = " "
        wait(0.5)
        script.Parent.Text = "W"
        wait(0.5)
        script.Parent.Text = "Wh"
        wait(0.5)
        script.Parent.Text = "Whe"
        wait(0.5)
        script.Parent.Text = "Wher"
        wait(0.5)
        script.Parent.Text = "Where"
        wait(0.5)
        script.Parent.Text = "Where "
        wait(0.5)
        script.Parent.Text = "Where a"
        wait(0.5)
        script.Parent.Text = "Where am"
        wait(0.5)
        script.Parent.Text = "Where am "
        wait(0.5)
        script.Parent.Text = "Where am I"
        wait(0.5)
        script.Parent.Text = "Where am I?"
    end
end)
0
Use a for loop my guy. Ziffixture 6785 — 2mo
0
It's good practice to use events instead of infinite loops. Having code run unnecessarily is... well unnecessary. SpelunkyGaming 34 — 2mo

Answer this question