This event is designed to colour parts inside a model that's been placed inside the character. It does not work in test or player mode. I suspect the problem may be passing the variable 'data' through but I don't know how else to do it. Many thanks!
Client
local player = game.Players.LocalPlayer local data = script.Parent local event = game.ReplicatedStorage:WaitForChild("ColouringEvent") script.Parent.MouseButton1Click:Connect(function() event:FireServer(data.Name) end)
Server
local event = game.ReplicatedStorage:WaitForChild("ColouringEvent") event.OnServerEvent:Connect(function(player, colour) local Target = game.ReplicatedStorage.Target local character = player.CharacterAdded:wait() local Get = character:GetChildren() for i = 1, #Get do if Get[i].ClassName == "Model" then local Gget = Get[i]:GetChildren() for i = 1, #Gget do if Gget[i].Name == Target.Value then Gget[i].BrickColor = BrickColor.new(colour) end end end end end)