Hi i am trying to make a textlabel visible when 1 of the 2 bool values changes both values are intvalues that do change as you can see it change in game and in rep storage. thank you in advace
text = script.Parent
local blueteam = game.ReplicatedStorage.guiteamboolean.blueteam.Value
local greenteam = game.ReplicatedStorage.guiteamboolean.greenteam.Value
local text = script.Parent
local blueteam = game.ReplicatedStorage.guiteamboolean.blueteam
local greenteam = game.ReplicatedStorage.guiteamboolean.greenteam
local function Load()
if blueteam.Value == greenteam.Value then
text.Visible = false
elseif blueteam.Value >= greenteam.Value then
text.Parent.Visible = true
elseif blueteam.Value <= greenteam.Value then
text.Parent.Visible = false
end
end
greenteam.Changed:Connect(Load)
blueteam.Changed:Connect(Load)
Hi Mate i gave it a shot in a local and server script there is no error but it still does not make the textlabel appear or disappear. any other thoughts?
local text = script.Parent
local blueteam = game.ReplicatedStorage.guiteamboolean.blueteam
local greenteam = game.ReplicatedStorage.guiteamboolean.greenteam
local function Load()
if blueteam.Value == greenteam.Value then
text.Visible = false
elseif blueteam.Value >= greenteam.Value then
text.Parent.Visible = true
elseif blueteam.Value <= greenteam.Value then
text.Parent.Visible = false
end
end
Load()
greenteam.Changed:Connect(Load)
blueteam.Changed:Connect(Load)
it works just fine for me may I see your explorer?
he doesn’t want to detect if both values are changed,
text = script.Parent
local blueteam = game.ReplicatedStorage.guiteamboolean.blueteam
local greenteam = game.ReplicatedStorage.guiteamboolean.greenteam
blueteam.Changed:Connect(function()
if blueteam == greenteam then
text.Visible = false
elseif blueteam > greenteam then
text.Parent.Visible = true
if blueteam < greenteam then
text.Parent.Visible = false
end
greenteam.Changed:Connect(function()
if blueteam == greenteam then
text.Visible = false
elseif blueteam > greenteam then
text.Parent.Visible = true
if blueteam < greenteam then
text.Parent.Visible = false
end
no your code will only work if both values are changing for ex :
lets say Value1 changed
the Load function is not going to work.
both values have to change
I think part of your problem is your declaring the team variables to the values at top and never updating in your while loop use .Value in the while loop to check current values. Also the text.Visible may need to be text.Parent.Visible
try the below code with use of .Value as current not set to value at top
local text = script.Parent
local blueteam = game.ReplicatedStorage.guiteamboolean.blueteam -- don't use value here it only sets once if you do that
local greenteam = game.ReplicatedStorage.guiteamboolean.greenteam -- don't use value here it only sets once if you do that
while wait(.2) do
if blueteam.Value == greenteam.Value or blueteam.Value < greenteam.Value then -- use .Value to check the current value
text.Parent.Visible = false -- did you mean to use text.Parent.Visible here instead of the text.Visible
elseif blueteam.Value > greenteam.Value then -- do elseif the top 2 not true
text.Parent.Visible = true
end
end