"Colour is not a valid member of RemoteEvent" Error?

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.

(colv is a color3value.)

Thanks!

The first parameter of a remote event (On the Server) is the player.

try this

game.ReplicatedStorage.ChangeColour.OnServerEvent:Connect(function(plr, colv)

Idk what “Colour” is I don’t see any word in your script that says “Colour”

I mean’t color, sorry about that!

1 Like

This is happening because in the

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	

Also do what Dolphin said to fix the parameters.

1 Like

Would I need to place the remote event in the folder with the parts? I’ve never really used events before sorry.

1 Like

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.

1 Like

It depends. If it’s a model I don’t really see any point on doing that @SimplyFrazer. Elsewhere I suggest you take Fusionnet’s method.

Okay, but can you show us a picture of all of replicatedstorage’s children?

It’s a folder.

And here is replicated storage.
image

Never mind, I removed all the events out the folder.

2 Likes

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.

1 Like

How did you write the event on the local script?

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)
1 Like

Easy fix. Looks like you forgot to add.

 game.ReplicatedStorage.Events.ChangeColor.OnServerEvent:Connect(function()
2 Likes

Sure, I can’t send an image because there is alot of parts. But there is no remote events.

image
I edited to say I removed them because I would need to edit all my scripts.

I put them there a few mins ago as suggested by @Fusionet

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”

2 Likes

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.

1 Like

Neon parts is a folder, does it make a difference?

1 Like

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.

1 Like

Okay, it worked, kinda. When I ran the script it made all the parts go fully black.


Lit up: (Studio view)

1 Like