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

int value not changing no matter what is picked?

Asked by 4 years ago

int value not changing

level = game.Workspace.RunningLevel
running = game.ReplicatedStorage.LevelName
Leveltime = game.ReplicatedStorage.Leveltime

if running.Value == redBlock then
    Leveltime.Value = 1

elseif running.Value == SalmonBlock then
    Leveltime.Value = 1

elseif running.Value == BlueBlock then
    Leveltime.Value = 1
    end
0
Is the default value 0? killerbrenden 1537 — 4y
0
no thenormalelevator32 26 — 4y
0
What is the default value set at? 1? killerbrenden 1537 — 4y
0
You have to do a while loop or :GetPropertyChangedSignal to check if the value has changed, that's the problem. killerbrenden 1537 — 4y

1 answer

Log in to vote
0
Answered by
0msh 333 Moderation Voter
4 years ago

as brenden said, you do either use :GetPropertyChangedSignal or any while loops.

while wait() do
level = game.Workspace.RunningLevel
running = game.ReplicatedStorage.LevelName
Leveltime = game.ReplicatedStorage.Leveltime

if running.Value == redBlock then
    Leveltime.Value = 1

elseif running.Value == SalmonBlock then
    Leveltime.Value = 1

elseif running.Value == BlueBlock then
    Leveltime.Value = 1
    end
end
Ad

Answer this question