Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why aren't my value-detecting scripts working?

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.

7 comments

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.

0

oilsauce he did put a yielding function : look at line 3

0

btw are you sure the script setting the value to 1 working ?

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.

0

I checked every time. The value DOES go to 1.

0

What I'm trying to do is make the marker be enabled, which is in a MISSIONS folder.

0

Ziffitxture can you be more specific? I tried using .Changed and :GetPropertyChangedSignal, but no luck. I also made my script a LocalScript.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.