Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why not changing color Character?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")

RemoteEvent.OnServerEvent:Connect(function(Player)
	local Character = Player.Character
	if (Character ~= nil) then
		for _,v in pairs(Character:GetChildren()) do
			if (v:IsA("BasePart")) then end
			if v.Name == "LeftHand" then 
				v.RightHand.BrickColor = BrickColor.new("Toothpaste")  
			end
			if v.Name == "LeftLowerArm" then 
				v.LeftLowerArm.BrickColor = BrickColor.new("Really red")  
			end
		end
	end
end)

I want it to change color only I don't want the full Body Hmmm Thank you I'm not good at writing code.

1 answer

✓ Accepted answer

Line 10 is messed up:

if v.Name == "LeftHand" then v.RightHand.BrickColor = BrickColor.new("Toothpaste")

In line 10, the part being detected is basically this:

Character.RightHand.RightHand

Fix:

if v.Name == "RightHand" then
	if v ~= nil then
		v.BrickColor = BrickColor.new("Toothpaste")
	end
end

If you have any questions, please ask them.

4 comments

0

who is "Them"

0

"them" refers to any questions he has if he has any

0

how to fix RightHand is not a valid member of MeshPart?

0

modified the script

This discussion is preserved as it was. New answers, comments, and votes are closed.