Hello, again. Does anyone know what the error “[Colour is not a valid member of RemoteEvent]” mesans?
My code is this and it’s in a server script.
local parts = game.Workspace.NeonParts:GetChildren()
game.ReplicatedStorage.ChangeColour.OnServerEvent:Connect(function(colv)
for i, v in pairs(parts) do
v.Color = Color3.fromRGB(colv)
end
end)
I searched on the developer forums and couldn’t find anything about it.
local parts = game.Workspace.NeonParts:GetChildren()
that you’re looping through, there must be a RemoteEvent in there.
RemoteEvents don’t have the Property “Color” so instead it checks for a child named “Color” inside the remote event, and there is none so it errors.
To fix this I would do:
for i, v in pairs(parts) do
if v:IsA("BasePart") then
v.Color = Color3.fromRGB(colv)
end
end
Remote Events can be placed anywhere where it can be recognized on both the client and server. I always put my remote events in ReplicatedStorage inside a folder and I recommend you should too.
Yes doing that is the correct placement for a RemoteEvent. Can you also send a picture or check inside the NeonParts and make sure there are no RemoteEvents in there.
local e = game.ReplicatedStorage.ChangeColour
local b = script.Parent
local colv = game.ReplicatedStorage.ColourValues.Colour
b.MouseButton1Click:Connect(function()
e:FireServer(colv)
script.Parent.Text = "Done!"
wait(1)
b.Text = "Apply Changes"
end)
Oh, okay then. So did that mean you took @Fusionet’s suggestion?
If that doesn’t really solve the problem idk why.
If it doesn’t work you can always send us the repro of what happened.
also, highly, highly suggest you take Dolphin’s method. On the API of remote events the first arg/par is the player, and cannot be changed. The second value is changeable and when not applied a value by the script itself its considered “nil”
If they were inside the NeonParts model, it won’t work or else that error will appear unless you check if it’s a part when looping through the model. You should put them there and change the rest of the scripts.
No it doesn’t, but make sure whatever is in there is a part and not a RemoteEvent. My first reply should be the solution to this problem, or putting the RemoteEvent somewhere else.