Keydown arm color changing script not working? (PLEASE READ BELOW!)
Asked by
8 years ago Edited 8 years ago
in full detail, I am trying to switch the color to the color black, then with the same key switch back to the player's original skin color, but using the same key (q). do i use elseif or what?
PROBLEM:
there are two problems,
1, being: I'm trying to make a script where if you click a certain key it
turns your arm black. if you click the same key you can revert to your original skin color.
it doesn't seem to work when i use elseif? im new to this so if you could help i'd be glad. without this I can't continue problem 2.
2, being: in line 54, it says that there is no such thing as BrickColor, in the player in workspace. once you fix 1, this one is the next problem.
THIS IS A LOCALSCRIPT.
01 | Player = game.Players.LocalPlayer |
02 | mouse = Player:GetMouse() |
04 | repeat wait() until Player.Character |
06 | local char = Player.Character |
07 | local torso = char:findFirstChild( "Torso" ) |
08 | local leftarm = char:findFirstChild( "Left Arm" ) |
12 | function onKeyDown(key) |
15 | local part = char [ "Left Arm" ] :Clone() |
16 | part.BrickColor = BrickColor.new( "Institutional white" ) |
17 | part.Material = "Neon" |
18 | part.Name = "LeftArm2" |
19 | part.CFrame = leftarm.CFrame |
21 | part.CanCollide = false |
25 | part.Size = part.Size +Vector 3. new( 0.1 , 0.1 , 0.1 ) |
26 | part.Transparency = part.Transparency + 0.1 |
27 | part.CFrame = leftarm.CFrame |
32 | leftarm.BrickColor = BrickColor.new( 'Really black' ) |
33 | leftarm.Material = 'Neon' |
34 | leftarm.Reflectance = 0.1 |
35 | torso.Anchored = false |
40 | local part = char [ "Left Arm" ] :Clone() |
41 | part.BrickColor = BrickColor.new( "Institutional white" ) |
42 | part.Material = "Neon" |
43 | part.Name = "LeftArm2" |
44 | part.CFrame = leftarm.CFrame |
46 | part.CanCollide = false |
50 | part.Size = part.Size +Vector 3. new( 0.1 , 0.1 , 0.1 ) |
51 | part.Transparency = part.Transparency + 0.1 |
52 | part.CFrame = leftarm.CFrame |
54 | leftarm.BrickColor = BrickColor.new(game.Workspace [ Player.Name ] .BrickColor.Value) |
61 | mouse.KeyDown:connect(onKeyDown) |
if you could help, i'd be thankful. thanks!