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

Why aren't my value-detecting scripts working?

Asked by 3 years ago

Hi there. I am currently trying to make a game and my scripts will not work for some reason! Take a look.

while true do
    local player = game.Players.LocalPlayer
    while wait() do
        if workspace.missionnum.Value == 1 then
            workspace.MISSIONS.RustyJohn.start["Text Show on touch"].Disabled = false
            workspace.MISSIONS.RustyJohn.start.Transparency = 0.5
        end
    end
end

By the way, 'missionnum' is a value, and when you complete the tutorial the value goes up to 1. I don't know why, but the script does NOT detect the value being 1 and does not enable the marker or do anything I tell it to.

0
What is the while loop at line 1 for? And since it doesn't have a yielding function inside it (like wait()), it would just break your script. oilsauce 196 — 3y
0
oilsauce he did put a yielding function : look at line 3 denbra37 34 — 3y
0
btw are you sure the script setting the value to 1 working ? denbra37 34 — 3y
0
Use :GetPropertyChangedSignal, it is much more efficient. Ensure you're using the appropriate program-family; a LocalScript is required here and must be located within a localized environment. P.S: Your adjustment to 'MISSIONS' is not authentic and won't replicate. If that is what you desire then that doesn't matter. Ziffixture 6913 — 3y
View all comments (3 more)
0
I checked every time. The value DOES go to 1. MrMonthh 11 — 3y
0
What I'm trying to do is make the marker be enabled, which is in a MISSIONS folder. MrMonthh 11 — 3y
0
Ziffitxture can you be more specific? I tried using .Changed and :GetPropertyChangedSignal, but no luck. I also made my script a LocalScript. MrMonthh 11 — 3y

1 answer

Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
3 years ago

Try this bro!

while true do
    local player = game.Players.LocalPlayer
    while wait() do
        if workspace:WaitForChild("missionnum").Value == 1 then
            workspace:WaitForChild("MISSIONS"):WaitForChild("RustyJohn"):WaitForChild("Start")["Text Show on touch"].Disabled = false
             workspace:WaitForChild("MISSIONS"):WaitForChild("RustyJohn"):WaitForChild("Start").Transparency = 0.5
        end
    end
end
Ad

Answer this question