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

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

Asked by 6 years ago

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
set the model position instead with setprimarypartcframe abnotaddable 920 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

item:SetPrimaryPartCFrame(script.Parent.Position)

Ad

Answer this question