Hello everyone. I wanted to make it so that if “value1” was true, the text of the gui was , and otherwise it is false, the text will be , but in response the text does not change at all.
Code:
local owns = game.ReplicatedStorage.Achievements.Test
while true do
wait(1)
if owns.Value == true then
local prt = script.Parent
prt.Text = "✅"
prt.TextColor3 = Color3.new(0.133333, 1, 0)
else
local prt = script.Parent
prt.Text = "❌"
prt.TextColor3 = Color3.new(1, 0, 0.0156863)
end
end
In addition you shouldn’t use while true do but instead use changed. Moreover, it’s better to combine the variables prt into one variable.
And you don’t have to write == true, because if you don’t write that part it’s automatically == true for the script.
local owns = game.ReplicatedStorage.Achievements.Test
owns.Changed:Connect(function()
local prt = script.Parent
if owns.Value then
prt.Text = "✅"
prt.TextColor3 = Color3.new(0.133333, 1, 0)
else
prt.Text = "❌"
prt.TextColor3 = Color3.new(1, 0, 0.0156863)
end
end)