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

Can someone Help with this welding script?

Asked by 9 years ago

I got the actual welding part down, but how do i make it so the player can move with the part welded to them. This is all done when the player hits a key while the tool is equipped.

01tool = script.Parent
02 
03player = game.Players.LocalPlayer
04stat = "undone"
05tool.Equipped:connect(function(mouse)
06    mouse.KeyDown:connect(function(key)
07        if stat == "undone" then
08            stat = "done"
09 
10        print(key)
11        local head = script.Parent.Parent.Head
12        local part = Instance.new("Part")
13        part.Parent = game.Workspace
14        local w = Instance.new("Weld")
15        part.CanCollide = false
View all 33 lines...

So far the actual part goes in the proper position but the player cannot move.

0
Parts must be unanchored if you want to weld them and have them move with the character. Redbullusa 1580 — 9y

1 answer

Log in to vote
0
Answered by
sigve10 94
9 years ago

In the end of the script (between "w.Parent = head" and "wait(15)") you have put "part.Anchored = true", but this would make the part unable to move. If you keep the anchored value False it would make the part movable, and it would still stick to the player. Therefore I would suggest you to change the "part.Anchored = true" to "part.Anchored = false".

I hope this helped

Ad

Answer this question