So i’m making a system where everybody is attached an invisible item to their avatars and the said item has a BillboardGUI with TextLabel as it’s child, so ServerScripts are the ones responsible in putting the item on everybody, since i want everybody to have the item, but TextLabel only visible to one person, so LocalScript was a way to go, thus i decided to link up however many players might there be to BoolValue, so that i could use a menu to change the aforementioned value and all the scripts inside the items could see it, that would be altered only locally, thus only the person who altered the value could see all the TextLabels, however, no matter what i do, the LocalScript that manages all the label visibility just doesen’t seem to react to any changes on the BoolValue (no, i won’t use …:IsChanged because i want the thing to be toggleable). So what i would like explained, is just why does it not react, since i looked over documentation, nothing of use that i could find.
this is… so confusing
any code???
local V = game.Workspace.Track
local Txt = script.Parent.BillboardGui.TextLabel
if V.Value == true then
Txt.Visible = true
else
Txt.Visible = false
end
“Track” is the BoolValue here
it simply refuses to react to any changes on the of BoolValue’s value
Because it’s not listening to changes.
local V = game.Workspace.Track
local Txt = script.Parent.BillboardGui.TextLabel
V.Changed:Connect(function()
Txt.Visible = v.Value
end)
V.Changed
just “listens” to see if the value changes or not. You also don’t need to use an if statement to see if V is true then set the Txt to visible as you can just set Txt.Visible to be V.Value.
oh boy
you absolute doofus, you lobotomized frankenstein
this will run once, and never again
you should do something like this
textlabel.Changed:Connect(function()
-- code
end)
NOOOO AWRY WAS FASTER
wait omg
AWRYYY CAN I ASK YOU A QUESTION ABOUT CFRAMES OR LERPING OR WHATEVER
I WANTED TO ASK YOU BBUT YOUR DMS ARE OFF
at the very least that provided me with free entertainment, but it turns out BoolValues are too complex to me yet, so i’m going with an alternate solution
wha?
too complex?
what?
it’s just a simple .Changed event (which should be of the value, not of the textlabel my bad lol)
what’s complicated about that
problem is, only the label of local player themselves is visible after setting up your code, but i want for the aforementioned player to see TextLabels of ALL the players currently ingame
edit: i also figured that it would be fine putting it in a ServerScript, since the activation itself happens on a LocalScript already, but that seems to break it completelly
Edit n.o. 2: i’m still somewhat of an ameateur dev, so don’t expect for me to understand what seems easy for you to understand, but i’m always open to learn more
So basically, Instance.Changed
is a signal that fires when any property of the instance changes. With :Connect
, we can bind code to run whenever that signal fires, so essentially we are binding code to run when the property changes.
However, I’d recommend :GetPropertyChangedSignal
, which will only fire when a specific property of the instance changes.
local value = workspace:FindFirstChild("Track")
value:GetPropertyChangedSignal("Value"):Connect(function() --bind this to run whenever Value is changed
--make them all visible here
end)
it sounds like you need an iteration to make all of the individual labels visible/invisible for each player visible, if they are in the character you can do something like this:
local players = game:GetService("Players")
for _, player in next, players:GetPlayers(), nil do
local char = player.Character
local gui = char:FindFirstChildOfClass("BillboardGui")
gui.Visible = value.Value
end
so i implemented this and while it works on the “host a server” feature of the studio, in actual game and for any other character it simply does not react
Are there any errors? If not, could you provide some more information about the setup of your labels?
Am I correct in thinking the value is modified on the server in both environments?
Actually, when it comes to value instances, the “Changed” event of the Instance class is overridden! The event now solely responds to changes in the value instance’s “Value” property, while also providing its listeners with the new state of that property. You should be using this event over Instance:GetPropertyChangedSignal
API Reference: BoolValue | Documentation - Roblox Creator Hub
Oh, great! I didn’t realise it was different for instance values than other instances. This does seem much more useful.
Thanks for the info! This should definitely be used instead here.