I'm trying to weld a gun to my characters hand in a hopperbin. The gun won't appear. This is in a local script.
01 | player = game.Players.LocalPlayer |
02 |
03 | ra = player.Character:WaitForChild( "Right Arm" ) |
04 |
05 | Tool = script.Parent |
06 |
07 | Tool.Selected:connect( function () |
08 |
09 | local Weld = Instance.new( "Weld" ,script.Parent.Flintlock) |
10 | Weld.Part 0 = ra |
11 | Weld.C 0 = ra.CFrame:inverse() |
12 | Weld.Part 1 = script.Parent.Flintlock |
13 | Weld.C 1 = script.Parent.Flintlock.CFrame:inverse() |
14 | script.Parent.Flintlock.CFrame = ra.CFrame * CFrame.new( 0 , 0 ,- 1 ) |
15 | script.Parent.Flintlock.Anchored = false |
16 | end ) |
HopperBins can not use parts like normal Tools.
I will edit my answer if I am wrong.
Also, you need to explain your question better, because my answer is possibly not what you were meaning to ask. Please don't downvote my answer because of that.
01 | local mouse = game.Players.LocalPlayer:GetMouse() |
02 |
03 | function Equip() |
04 | -- Put Equip Here |
05 | end |
06 |
07 | function KeyUp(key) |
08 | if key = = "1" then |
09 | Equip() |
10 | end |
11 | end |
12 |
13 | mouse.KeyUp:connect(KeyUp) |
That's what I would do if you really wanted to use a hopper bin.