Skip to content

Instantly share code, notes, and snippets.

@spotco
Created May 4, 2017 07:16
Show Gist options
  • Select an option

  • Save spotco/f591a2b84a215f1408ce5a3ed86fcf72 to your computer and use it in GitHub Desktop.

Select an option

Save spotco/f591a2b84a215f1408ce5a3ed86fcf72 to your computer and use it in GitHub Desktop.
motor6d and weld creator
-- Motor6D creator
local target_part = game.Workspace.StarMachineHumanoid.NeckCenter
local selection_part = game.Selection:Get()[1]
local motor6d = Instance.new("Motor6D")
motor6d.Part0 = target_part
motor6d.Part1 = selection_part
motor6d.C1 = CFrame.new(0,0,0)
motor6d.C0 = motor6d.Part0.CFrame:inverse() * motor6d.Part1.CFrame
motor6d.Parent = selection_part
-- Weld creator
local target_part = game.Workspace.StarMachineHumanoid.BaseCenter
local selection_part = game.Selection:Get()[1]
local motor6d = Instance.new("Weld")
motor6d.Part0 = target_part
motor6d.Part1 = selection_part
motor6d.C1 = CFrame.new(0,0,0)
motor6d.C0 = motor6d.Part0.CFrame:inverse() * motor6d.Part1.CFrame
motor6d.Parent = selection_part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment