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

Why isn't BoolValue detect script for Gui NOT working?

Asked by
acuaro 29
5 years ago

I'm working on a game where you can click on the environment around you and text will pop up about it ( if you've played Undertale or Deltarune, it's sort of like that). The problem is, the text is not showing up when you click on the stuff. I have a script inside a part that will make a value called "playText" (playText is a BoolValue) equal to true (which works). Though, my detector script which detects if the change has happened is not working for some reason. Here's my script

local textElement = script.Parent
local sound = script.Parent.Select
local text = "* Your move in boxes, though, thinking about your old town makes you sad."
while wait() do
    while script.Parent.playText.Value == true do
        script.Parent.Parent.Parent.Enabled = true
        script.Parent.Parent.Visible = true
        print("boxes")
        for i=1, string.len(text), 1 do
            textElement.Text = string.sub(text,1,i)
            sound.Playing = true
            wait(0.1) 
        end
        wait(3)
        script.Parent.Parent.Parent.Enabled = false
        script.Parent.Parent.Visible = false
        break
    end
end

If I set "playText" to true to start with and THEN test the game, the text pops up fine. I'm really confused and any help would really be appreciated. Thanks in advance!

Answer this question