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

When the code is disabled the text should change but it's not doing it and i don't understand why??

Asked by 4 years ago

(This is in a server script) These are just the lines of code that are broken How is it not changing the text I don't get it. and yes the code is disabled

    if game.ServerScriptService.StarterGlass.BreakScript.Disabled == true then
    player.PlayerGui:FindFirstChild("Tutorial").Frame.Info.Text = "Good!"

1 answer

Log in to vote
0
Answered by 4 years ago

In this script, it checks if is disabled just a fraction of a second when the server starts. You should hook it up to an event or a loop. Like this.

while true do
wait(1)
if game.ServerScriptService.StarterGlass.BreakScript.Disabled == true then
player.PlayerGui:FindFirstChild("Tutorial").Frame.Info.Text = "Good!"
end

I am using wait(1) to make sure it does not lag anything. This is not tested, so it might not be 100% accurate.

0
Oh thank i thinked of it but i thougth that would not be the problem. Freddan2006YT 88 — 4y
1
You should use GetPropertyChangedSignal for Disabled. hiimgoodpack 2009 — 4y
0
Oh, forgot to say it just times out and the script stops working. Freddan2006YT 88 — 4y
Ad

Answer this question