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

How would I go on about checking multiple values every second?

Hello. I am making a game that each level is unlocked if the value is a certain value. Any working answer is appreciated. Here is my script.

local playerlevels = game.ReplicatedStorage.Values:WaitForChild("thelevels")



while true do
	wait(1)
	print("check complete.")
if playerlevels.Value == 1 then
	game.Workspace.livingroom.bedroomdoor.bedroomdoor.ClickDetector.MaxActivationDistance = 15000
end

if playerlevels.Value == 2 then
	game.Workspace.office.bedroomdoor.bedroomdoor.ClickDetector.MaxActivationDistance = 15000
end

if playerlevels.Value == 3 then
	game.Workspace.basement.bedroomdoor.bedroomdoor.ClickDetector.MaxActivationDistance = 15000
end

if playerlevels.Value == 4 then
	game.Workspace.attic.bedroomdoor.bedroomdoor.ClickDetector.MaxActivationDistance = 15000
end
end

Whenever I run the script, and change the value, it does not change the MaxActivDistance.

5 comments

0

game.ReplicatedStorage.Values line seems sus. I'm prob wrong

0

its the folder

0

ohhhh

0

Try doing game.Workspace.attic.bedroomdoor.bedroomdoor.ClickDetector.MaxActivationDistance == 15000. I don't think that its right, but try that

0

No, because that is used in an IF statement.

1 answer

✓ Accepted answer

Use a while true do loop properly

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