What is better to use when i want to change the local player gui wave information, have a number value that server will change it when new wave steps in and local script will detect the change and update the gui, or use remote event to fireallclients that holds the wave information, i want to optimize the game as much as possible, thank you
I think this would be the best way since sending remoteevents uses up data whereas this works perfectly fine, its simple and doesn’t use up as much data:
Currency:GetPropertyChangedSignal("Value"):Connect(function()
TextLabel.Text = Currency.Value
end)
:GetPropertyChangedSignal() is similar to .Changed but better.
from my understanding, getpropertychangedsignal only looks at certain property so it wont always fire unless the one changed is the one im focusing on, il keep that in mind, thanks
I would use an attribute.
Have an event handle if the attribute is changed on the client
and the server sets the attribute.
@AustnBlox would actually be incorrect here about GetPropertyChangeSignal
Changed
is actually better when it comes to ValueBase
Instances
, as when Connected to ValueBase
Instances
, you would actually return the new value of the Instance
instead of its Property.
NumberValue.Changed:Connect(function(value)
print(value) --> number can vary from change
end)
Why not just define th new value at the top of the line property changed signal? Changed isn’t useful unless you want to listen to every value change.
Because this Parameter does not exist. The Event does not keep track of the new value.
Changed
does not function the same with ValueBase
Instances
, it will get the new value when it changes instead of the Property.
local value = Instance.new(“NumberValue”)
value:GetPropertyChangedSignal(“Value”):Connect(function()
local latestValue = value.Value
end)
Yes, but you can just use Changed
which:
value.Changed:Connect(function(v)
print(v) --> the newest value
end)
value:GetPropertyChangedSignal("Value"):Connect(function(v)
print(v) --> nil (Does not keep track of the value)
end)
Which like I said above for like two times:
It would be better to use Changed
for ValueBase
Instances
I don’t think you get my point, but have a nice night regardless.
going to bed
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.