while playing==true do
wait(2)
local choose = math.random(1, 6)
if choose == 1 then
text.Text = "Red"
RedParts.Parent=workspace
text.TextColor3=Red
text.Parent.BackgroundColor3=Red
wait(2)
PurpleParts.Parent=rs
RedParts.Parent=workspace
BlueParts.Parent=rs
GreenParts.Parent=rs
YellowParts.Parent=rs
OrangeParts.Parent=rs
elseif choose == 2 then--continuses the same proccess with a different color blah blah blah
end```
#I want to make it so that when playing==false the loop stops until playing is back on
1 messages · Page 1 of 1 (latest)
It works fine regularly but whenever I use the Boolean value to turn it on and off the script breaks, only thing I can think of is putting it as a remote event in my timer script(which is the one that togles playing on/off)

use getpropertychangedsignal to detect when playing value changes
I tried that with an if statement inside as well but it still gave me the same results as the way displayed In the script I sent(the script breaking) except if you mean putting it next to the if choose==1 then like if choose==1 and playing==true then
a while loop is gonna stop and never run again after playing == false
Shit that's mb then
also instead of a bunch of if statements for choose you could use a table
I know
something like
local colours = {red, blue, yellow, etc}
then text.Text = colors[choose]
The game logic is shitty ah indeed I'm just focusing on getting this thing to actually work first and then I'm tidying it up
workspace[colors[choose].."Parts"].Parent = workspace
no sense in writing code you know is shitty to clean it up later, might as well clean it the first time so you can focus on what doesnt work
I'll try in a bit cus my laptop is charging 💔💔
If it works it works ig, either way I just suck at coding and only realised how messy ts was after finishing the code
First of all, saving a value to a variable like this won’t actually update when the value is changed, it will store the initial value and won’t update no matter if the actual value is changed or not
Second of all, just use while true do and in the while loop add an if statement to check if playing.Value is true, then execute code.
This way you just do nothing until playing == true and then you enter the if statement
i did mention that i did that as well and it wouldnt work 😅
@s... hey could u help me out here ive never used GetPropertyChangedSignal() before but this is defo wrong ```local cdown = game.ReplicatedStorage:WaitForChild("cdown")
cdown:GetPropertyChangedSignal('Value'):Connect(function(property)
while true do
if cdown.Value==false then
reset()
wait()
else
wait(2)--rest of the script
no bro so unperformant, use getpropertychanged so its only running when you actually want it to
im gonna spoonfeed cuz this is making me tweak
also i should prolly just get to cleaning up the script first as mentioned...
shit what am i even doiing w the property paramater O.o
local colours = {"Red", "Yellow", "Blue"}
local playing = game.ReplicatedStorage:WaitForChild("playing")
local partsfolder = game.ServerStorage.PartsFolder
local partsfolderinit = partsfolder:GetChildren() --idk whereever u keep the parts
playing:GetPropertyChangedSignal("Value"):Connect(function(property)
local choose = math.random(1, 6)
if playing.Value == true then
task.wait(2)--idk why u have this but i kept it
text.Text = colours[choose]
task.wait(2)
for i, parts in partsfolderinit do
parts.Parent = partsfolder
end
partsfolderinit[colours[choose].."Parts"].Parent = workspace
--i dont think u can just do Color3 = Red but idk maybe u can
end
end)
very generous of u 
i defined the colors above but not visible here
Thats cause you implemented it wrongly.
It works for everyone else, why wouldn’t it work for you
Dude what
I’m here trying to help
Its not my problem right? I could’ve just ignored you but i decided to help. And thats the response?
Whats wrong with you?
People these days.
You did not show much respect either so why would I? "It works for everyone else, why wouldn’t it work for you" is also pretty rude imo, If you do not find it rude then well, what I sent, it's just a GIF, not that deep lol. I got what u said the first time when you said I implemented it wrong, you act like I'm one of those kids with 0 scripting knowledge under scripting tutorials that just copy the whole code and then cry and hate on the guy who uploaded the video as if it just happened to work for the creator but not them, I also have shit knowledge, I started in January, when I even had the time to script but I'm trying my best, I did mention I used an if statement before u even pointed it out so least u could do would be to just help me instead of shitting on me, perchance.

I am not shitting on you, but confidently ruling out my solution that works, and i know for a fact that it works, is.. not very respectful either. I did not disrespect you before you did it to me.
Now, i don’t hate on anybody, i just don’t like your attitude to people trying to help. Maybe you could share what you made so i could help you discover the issue, instead of writing a pragraph of how disrespectful i am for trying to help.
And i never said anything about you having no knowledge.
I still think your initial response was rude and I was in the right; I was definitely not ruling out your solution , if anything I was just expecting u to guide me on what's going wrong ... The having no knowledge part was just an addition to what I was saying about you treating me like a kid with 0 scripting knowledge or will to learn and whatever else I wrote... Anyway, I apologise for coming out a bit rude, although it's really just a GIF in response to u being disrespectful first, and I think my attitude before that gif was fine.
Everything aside, I'll just apologise for good here; I'm sorry for being rude. Ta da.
Sorry I'm not good at apologising
I swear it's just that I'm acc sorry
Anyway, if u hopefully accept my apology then I'm not on my laptop right now but idk a bit unorthodox I guess, I basically have a timer script for the intermission and I just made it disable that script each time the playing is false, instead of changing it through the script itself, maybe a weird approach but it's getting the job done, until I maybe find a more reliable approach.
i literally gave u the code and u used a scuffed solution instead
i just didnt know how to incorporate that into my script + i have shit knowledge about in pairs loops, i just got back on my laptop so ofc id consider ur script sowwy
I’ll say sorry too, could you share your implementation of the if-statement?
DISCORD 📜
Join my Discord Community if you want scripting help, participate in events/challenges, and make friends!
https://discord.gg/WC6kPu5W5P
MEMBERSHIPS 🎁
Get Access To My Scripts + More Perks By Becoming a Channel Member! 👇
https://www.youtube.com/@BrawlDevRBLX/join
BEGINNER ROBLOX SCRIPTING SERIES 🟢
https://youtube.com/playl...
srry ill text in a bit im tidying up the scripts
part.Parent=workspace:FindFirstChild(nameRandom..'Parts')
would this b correct to parent to parent eg if the color is Red to a folder name RedParts
local Green = Color3.new(0.333333, 0.666667, 0)
local Blue = Color3.new(0, 0, 1)
local folder=Instance.new('Folder')
folder.Parent=workspace
folder.Name='RedParts'
for i,v in pairs(workspace:GetDescendants()) do
if v:IsA('Part') and v.Name=='Red' then
v.Parent=folder
end
end```
this was my initial script
but it wouldn't work for some reason it just created the folders in the workspace
Name Random is the string of the colour name and then I merged it with 'Parts' to find the folder in the workspace but it would turn out really broken
Anyway I cleaned up the first script, got a better understanding of in pairs loops as well in the mean time but my laptop ran out of battery again 💔💔
And now the colour changing block thingy got messed up so...

maybe I'll just continue with my if loop spam masterpiece
ok it worked nvm
nvm it didnt
Please dont