Changing the color of the tool according to the players right arm color

I have been trying to get these scripts to work, and i was wondering if anyone could help me.

Im trying to get it to get the players right arm color from a local script and then with a remote event show the new color to everyone in the server

local rs = game:GetService("ReplicatedStorage")
local skinchange = rs.skinchange
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local chr = player.Character or player.CharacterAdded:Wait()
	if not player:HasAppearanceLoaded() then
		player.CharacterAppearanceLoaded:Wait()
	end

		
		local bodycolors = chr["Body Colors"]
		skinchange.OnServerEvent:Connect(function(player, handle)
			handle.BrickColor = bodycolors.RightArmColor
		end)
end)

Ok so above me is the server script i put into serverscriptservice

and under me is the one the one thats in the tool (its obv a local script)

local rs = game:GetService("ReplicatedStorage")

local skinchange = rs.skinchange

local Players = game:GetService("Players")

local player = Players.LocalPlayer

local character = player.Character or player.CharacterAdded:Wait()

if not player:HasAppearanceLoaded() then

player.CharacterAppearanceLoaded:Wait()

end

local bodycolors = character["Body Colors"]

local tool = script.Parent.Parent

local handle = script.Parent

tool.Equipped:Connect(function()

skinchange:FireServer(handle)

end)

i have been trying so hard its just not working, the problem is that it sometimes works and sometimes it just doesnt, also when i reset it just stops working, if anyone is able to, Help would be appreciated!
: D

Something like this would be a lot more straight forward:

local Tool = script.Parent
local Handle = Tool.Handle

Tool.Equipped:Connect(function()
	local Character = Tool.Parent
	local LeftHand = Character.LeftHand
	Handle.BrickColor = LeftHand.BrickColor
end)

This would be a server script under the tool.

Posting it here too.

1 Like