What do I want to achieve?
I wish to achieve for my script to check a string value in ServerStorage, then edit the text labels color according to if it’s clear/empty.
What is the issue?
I keep getting this error:
I’m very confused as to why this keeps happening whenever the value gets changed.
When I click on this error, it returns me to this line:
if room.Value ~= "" then
script.Parent.BackgroundColor3 = Color3.fromRBG(255, 0, 0) -- returns me here
end
Full code:
while true do
local room = game.ServerStorage.Normal_Rooms:FindFirstChild(script.Parent.Name)
if room.Value == "" then
script.Parent.BackgroundColor3 = Color3.fromRGB(0, 255, 8)
end
if room.Value ~= "" then
script.Parent.BackgroundColor3 = Color3.fromRBG(255, 0, 0)
end
wait(.5)
end
What solutions have you tried so far?
I originally had local room = ...
out of the while true do loop, thinking the value may need re-read or something along those lines. But I still have the same error. I’ve looked up information on ServerStorage and I still can’t find the correct solution.
Script Location:
Value Location:
I put the locations here, as I’m unsure if how I have this set up may just be the problem.