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

Tool weld with a workspace part?

I did a gun with a shield,but the shield doesn't stop the bullets,and my solution was welding a invisible part of workspace to the riot tool,i did that script,but it's not working!:< It's a normal script inside the tool

local prev 
local parts = workspace.Part
for i = 1,#parts do 
if (parts[i].className == "Part") then 
if (prev ~= nil)then 
local weld = Instance.new("Weld") 
weld.Part0 = prev 
weld.Part1 = parts[i] 
weld.C0 = prev.CFrame:inverse() 
weld.C1 = parts[i].CFrame:inverse() 
weld.Parent = prev 
end 
prev = parts[i] 
end 
end 
wait(3) 
script:remove()

1 comment

0

this is a free model

1 answer

What you did wrong is that you INVERSE Nothing so they doesnt get stuck to each other to fix this you need to Inverse them

local prev 
local parts = workspace.Part
for i = 1,#parts do
if (parts[i].className == "Part") then
if (prev ~= nil)then
local weld = Instance.new("Weld") 
weld.Part0 = prev 
weld.Part1 = parts[i]
weld.C0 = prev.CFrame:inverse() *parts[i]
weld.Parent = prev 
end
prev = parts[i]
end
end
wait(3) 
script:remove()

I hope I helped you :D

1 comment

0

Not working.

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