Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(SOLVED) How do I get a players skin tone and put that skin tone on something else?

Asked by 3 years ago
Edited 3 years ago

So i'm making a game and i want to get a players skin tone onto a brick and i want to know how to do that. If you want to know what I am doing then I will tell you for more context. I am making a shooter game and the arms for the shooter game needs to be the color of the players arm so it matches up.

My code:

------Variables------

local PlayerName = game.Players.LocalPlayer.Name
local Arms = game.Workspace.Arms
local Camera = game.Workspace.Camera
local Run = game:GetService("RunService")

Run.RenderStepped:Connect(function()
    Arms.HumanoidRootPart.CFrame = (Camera.CFrame * CFrame.new(0,-1.5,0))
end) 

------Hand Color------

while true do
    Arms.LeftArm.BrickColor = PlayerName("Left Arm").BrickColor
    Arms.RightArm.BrickColor = Arms.LeftArm.BrickColor
end

0
I'm not 100% sure, but in line 15 it should be PlayerName["Left Arm"]. Also, there should be a wait() in the loop otherwise it will timeout, secondly it's better if you put lines 15 and 16 in the RenderStepped connection in line 08. radiant_Light203 1166 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Ok, there's multiple problems with your script. In the player variable, you assigned it the local player's name. Unless you're searching for it in players, the script is not gonna know what you're talking about. The left arm is apart of the player's character, not the player. And you don't have to put it in a loop.

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

Arms.LeftArm.BrickColor = character["Left Arm"].BrickColor
Arms.RightArm.BrickColor = character["Right Arm"].BrickColor
0
i forgot to say thanks IceNinja225500 8 — 3y
Ad

Answer this question