Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to stop a weld from breaking when teleporting a part?

I need help with my item spawner script. It teleports a gun to it. But it only teleports the handle. I have a welding script in it. this is the code of the item spawner.

script.Parent.Name = script.Parent.Position.X..", ".. script.Parent.Position.Y ..", ".. script.Parent.Position.Z
script.Parent.Transparency = 1
script.Parent.Anchored = true
script.Parent.CanCollide = false

local items = script.Parent.SpawnableItems:GetChildren()

math.randomseed(tick())

local itm = items[math.random(0,#items)]:Clone()

itm.Parent = game.Workspace.SpawnSystem.SpawnedItems
itm.Handle.Position = script.Parent.Position
itm.Handle.Orientation = script.Parent.Orientation

any help will be greatly appreciated.

1 comment

1

set the model position instead with setprimarypartcframe

1 answer

✓ Accepted answer

item:SetPrimaryPartCFrame(script.Parent.Position)

This discussion is preserved as it was. New answers, comments, and votes are closed.