I have a piece of code that is supposed to change the color of the character's limbs as seen below:
LocalScript (located under a textButton):
local button = script.Parent
local player = game:GetService("Players").LocalPlayer
local BodyColor = Color3.new(0,0,0)
button.MouseButton1Down:connect(function()
print("hello")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("ChangeColorEvent")
createPartEvent:FireServer(BodyColor)
end)
Server Script (located in ServerScriptService):
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = Instance.new("RemoteEvent", ReplicatedStorage)
local character
createPartEvent.Name = "ChangeColorEvent"
local function onFired(player, BodyColor)
character = player.CharacterAdded:Wait()
character.Torso.Color = BodyColor
character.LeftFoot.Color = BodyColor
character.LeftHand.Color = BodyColor
character.RightHand.Color = BodyColor
character.RightFoot.Color = BodyColor
end
createPartEvent.OnServerEvent:Connect(onFired)
Although both events and functions are firing, the color of the character is not changing. Any ideas on why it isn't working?
