.Changed fires when a property of the object it’s connected to is changed.
In this case, I assume you’re trying to consistently fire a RemoteEvent. .Changed basically has nothing to do with this (in regards to the RemoteEvent instance itself), although the person that told you to use .Changed is correct, in most scenarios.
Generally, firing RemoteEvents in a while loop is a pretty bad idea. What I recommend doing is checking if those bars change at all, and then firing the event then.
right now you’re waiting for the remote to be changed instead of waiting for .OnClientEvent (server doing Remote:FireClient(player, data) or Remote:FireAllClients(data)). meaning doing Remote.Changed is just pointless
you should use .Changed on your slidervalues instead and fire the remote when they’re being changed
also :GetPropertyChangedSignal() requires a property name so you can detect a change in a specific argument. you didn’t specify a property so you got an error
Alright you have the wrong idea on how to use remote events. You want to do the property changed signal on the sliders, not the remote event. Remote events are used to send and/or receive data from the server.
since you probably want to :FireServer(colors) everytime a value changes
i’m sure the first thing you’re thinking is to do something like this
local Holder = script.Parent -- avoid using script.Parent so many times (just make a variable)
local RColor = Holder.RedBar.SliderValue
local GColor = Holder.GreenBar.SliderValue
local BColor = Holder.BlueBar.SliderValue
RColor:GetPropertyChangedSignal("Text"):Connect(function(newVal)
Remote:FireServer(RColor.Text, GColor.Text, BColor.Text)
end)
GColor:GetPropertyChangedSignal("Text"):Connect(function(newVal)
Remote:FireServer(RColor.Text, GColor.Text, BColor.Text)
end)
BColor:GetPropertyChangedSignal("Text"):Connect(function(newVal)
Remote:FireServer(RColor.Text, GColor.Text, BColor.Text)
end)
but you can shorten it with a loop
local Holder = script.Parent
local RColor = Holder.RedBar.SliderValue
local GColor = Holder.GreenBar.SliderValue
local BColor = Holder.BlueBar.SliderValue
for _, Color in ipairs(Holder:GetChildren()) do
-- check if there's a SliderValue incase you try to access another element
if not Color:FindFirstChild("SliderValue") then continue end
Color.SliderValue:GetPropertyChangedSignal("Text"):Connect(function()
Remote:FireServer(RColor.Text, GColor.Text, BColor.Text)
end)
end