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

How do I change the players color and then change it back to what it was?

I'm like really new to scripting so I don't know if it's simple or not but lets say I change the players Left Arm Color to Quill grey

local Player = game.Players.LocalPlayer
local Character = Player.Character
local LeftArm = Character:WaitForChild("Left Arm")
local Button = script.Parent.Button
local Colored = false

Button.MouseButton1Down:Connect(function()
	if Colored == false then
	LeftArm.BrickColor = BrickColor.new("Quill grey")
	Colored = true
	elseif Colored == true then 
	-- This is what I don't know how to
	-- I want it to go back to the players original color
	Colored = false

	end
end

So basically I want it to return to the players orignal arm color

1 answer

✓ Accepted answer

I edited your code, try this one if it works.

local Player = game.Players.LocalPlayer
local Character = Player.Character
local LeftArm = Character:WaitForChild("Left Arm")
local Button = script.Parent.Button
local Colored = false

Button.MouseButton1Down:Connect(function()
if Colored == false then
    local Original = LeftArm.BrickColor
    LeftArm.BrickColor = BrickColor.new("Quill grey")
    Colored = true
    elseif Colored == true then 
	    LeftArm.BrickColor = Original
	    Colored = false
    end
end

2 comments

0

I basically made a variable of the brickcolor of the leftarm before its changed.

0

Thanks :)

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