[Inactive] Why does my keys not work when i try to "drop" the other one?
Asked by
5 years ago Edited 4 years ago
i have 2 Keycard and they have this script:
01 | local KeyName = script.KeyName |
02 | local KeyColor = script.KeyColor |
03 | KeyName.Value = script.Parent.Parent.Name |
04 | local colorBlock = script.Parent.Parent.Clr |
05 | colorBlock.BrickColor = KeyColor.value |
07 | script.Parent.MouseClick:Connect( function (plr) |
08 | local chr = plr.Character |
09 | local key = script.Parent.Parent |
12 | if chr:FindFirstChild(KeyName) then |
13 | local oldKey = chr:FindFirstChild(KeyName) |
14 | oldKey.Parent = workspace |
15 | oldKey.WeldConstraint:Destroy() |
16 | oldKey.CFrame = key.CFrame * CFrame.Angles( 0 , 0 ,math.rad( 15 )) |
20 | key.CFrame = chr.RightHand.CFrame * CFrame.Angles(math.rad( 90 ), 0 ,math.rad( 180 )) |
22 | local weld = Instance.new( "WeldConstraint" ) |
25 | weld.Part 1 = chr.RightHand |
Workspace:
https://imgur.com/a/fWASchb
When you pick one up it does that fine but when you click another one it should drop the one you just picked up and then pick up the other one. idk why it doesnt work but it just doesnt.
Edit: Ive done everything on GnomeCode's tutorial or whatever it is. https://www.youtube.com/watch?v=s-zXAgU_sKA&t
Everything else works fine except the keys