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

What's wrong with my weld script?

Asked by 9 years ago

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.

01player = game.Players.LocalPlayer
02 
03ra = player.Character:WaitForChild("Right Arm")
04 
05Tool = script.Parent
06 
07Tool.Selected:connect(function()
08 
09        local Weld = Instance.new("Weld",script.Parent.Flintlock)
10        Weld.Part0 = ra
11        Weld.C0 = ra.CFrame:inverse()
12        Weld.Part1 = script.Parent.Flintlock
13        Weld.C1 = script.Parent.Flintlock.CFrame:inverse()
14        script.Parent.Flintlock.CFrame = ra.CFrame * CFrame.new(0,0,-1)
15        script.Parent.Flintlock.Anchored = false
16end)

2 answers

Log in to vote
0
Answered by 9 years ago

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.

Ad
Log in to vote
0
Answered by
Voltoxus 248 Moderation Voter
9 years ago
01local mouse = game.Players.LocalPlayer:GetMouse()
02 
03function Equip()
04 -- Put Equip Here
05end
06 
07function KeyUp(key)
08if key == "1" then
09Equip()
10end
11end
12 
13mouse.KeyUp:connect(KeyUp)

That's what I would do if you really wanted to use a hopper bin.

Answer this question