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

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

Asked by
Blob_y 2
5 years ago

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

Log in to vote
1
Answered by
CjayPlyz 643 Moderation Voter
5 years ago

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
0
I basically made a variable of the brickcolor of the leftarm before its changed. CjayPlyz 643 — 5y
0
Thanks :) Blob_y 2 — 5y
Ad

Answer this question