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

What is wrong with this script?[Not answered]

Asked by 10 years ago

Am I missing something?

local function weldBetween (a,b)
    local weld = Instace.new ("ManualWeld")
    weld.Main = a----Part 1
    weld.Part1 = b----Part 2
    weld.C0 = Cframe.new()---Determines how offset the first part should be 
    weld.C1 = b.Cframe:Inverse() *a.Cframe ---* moves do the cframe
    weld.Parent = a
    return weld;


end

weldBetween (game.Workspace.Drone.Main, game.Workspace.Drone.Part1
0
Please reformat your code. RedCombee 585 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Try this:

local function weldBetween(a,b)
    local weld = Instance.new("Weld")
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = CFrame.new()
    weld.C1 = b.CFrame:inverse()*a.CFrame
    weld.Parent = a
    return weld;
end

weldBetween()--[[put where you want the weld to be between in these ()
example: weldBetween(game.Workspace.weldExample1, game.Workspace.weldExample2)
they both are parts btw --]]
0
ITSolarWinds, i can't comment on you question for some reason but yes try that but remove line 13 cutennipples2 15 — 10y
0
in you 2nd questiong after me sorry cutennipples2 15 — 10y
0
Ok thanks! ITSolarWinds 25 — 10y
0
It says there is an error in the output 12:50:59.130 - Stack Begin 12:50:59.131 - Script 'Workspace.Weld', Line 2 - local weldBetween 12:50:59.131 - Script 'Workspace.Weld', Line 12 12:50:59.132 - Stack End ITSolarWinds 25 — 10y
Ad

Answer this question