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

How do I weld a cloned model's part to the character?

Asked by
Lyphios 77
4 years ago
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:Wait()
local n = player.Name
local haha = game.ReplicatedStorage.saberlight:Clone()


wait (0.1)
haha.Parent = game.Workspace

local welderlol = Instance.new("WeldConstraint")
welderlol.Part0 = n.RightHand
welderlol.Part1 = haha.Union

heylo gaemers this code is meant to first clone a stored model, and then parent it to workspace every time a player joins. I already messed that part up. And then it's supposed to create a new weldconstraint to from one part of the model to the players right hand. Could I just use tools? yes and I do have a tool if all else fails. Do I want to? hell no, this is a very lenient challenge. Please correct and clean up my script or else I will cry to mommy.

1 answer

Log in to vote
1
Answered by 4 years ago

Hello. You forgot to set the Parent of the weld. Also, the weld might not work because of filtering enabled. If it doesn't then use a RemoteEvent. Try this:

local player = game.Players.LocalPlayer
local character = player.CharacterAdded:Wait()
local n = player.Name
local haha = game.ReplicatedStorage.saberlight:Clone()


wait (0.1)
haha.Parent = game.Workspace

local welderlol = Instance.new("WeldConstraint")
welderlol.Part0 = n.RightHand
welderlol.Part1 = haha.Union
welderlol.Parent = n.RightHand

Please accept and upvote this answer if it helped.

Ad

Answer this question