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

Localscripts not working for unknown reasons?

Asked by 1 year ago
Edited 1 year ago

I'm going to explain in short. There are script on the starterGui which need to acces data from the player. To make it easier, i decided to place values inside a folder in the StarterGui, the values would be changed by a localscript. I made it this way so its easier for the localscripts inside the StarterGui to acces the value.

There are 2 values i added. 1, StatusAvailable, letting scripts know if the status has been changed so it doesn't read any false things. And 2, the main value which contains the information needed.

I don't know which script is at fault

The localscript that updates the values:

while wait()do
    wait(3)
    if game.Players.LocalPlayer.OSinstalled.OSstate.Value == true then
        script.Parent.OS.Value = true
        script.Parent.OS.StatusAvailable = true
    else
        script.Parent.OS.Value = false
        script.Parent.OS.StatusAvailable = true
    end
end

The localscript that acceses the values:

        if script.Parent.Parent.Values.OSinfo.OS.StatusAvailable.Value == true then
            if script.Parent.Parent.Values.OSinfo.OS.Value == true then
                script.Parent.status.Text = --text
            else
                script.Parent.status.Text = --text
            end
        else
            script.Parent.Error.Visible = true
            script.Parent.text.Visible = false
            script.Parent.status.Text = -- here comes an error code

        end
        break
    else

    end
0
in "script.Parent.status.Text = -- here comes an error code" are you trying to set the Text of a Label to nothing? Use "script.Parent.status.Text = nil" brandons2005 87 — 1y
0
Also maybe I'm misunderstanding, but it seems like you could combine both scripts if they are two separate localscripts. an "if" statement at the beginning of a script will activate at the start of your game and never again unless specified. brandons2005 87 — 1y
0
No, the error text will display a error code. I have tried changing some things, and it turns out that the localscripts can't find the values inside the folder?? this is very confusing because other localscripts can TheEggGamerRobloxYT 0 — 1y

Answer this question