Advertisement
gamesreboot

Retros Hammer editor RigBuilder plugin code

Jul 14th, 2022
1,390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.39 KB | None | 0 0
  1. local pluginService = require(game.ReplicatedStorage.PluginsService)
  2.  
  3. script.Parent.MouseButton1Click:Connect(function()
  4.     local dockinfo = pluginService.DockWindowInfo.new("Floating", true, false, UDim2.new(0.2, 0,0.438, 0)) -- this creates a dockinfo
  5.     local dock = pluginService:CreateDockWindow("Rig Builder", dockinfo) -- creates a dockwindow
  6.     local main = dock.Parent.Parent
  7.     local addinstance = require(main.Explorer.AddInstance)
  8.     dock.BackgroundColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  9.     dock.BackgroundTransparency = .5
  10.     local TextButton = Instance.new("TextButton") -- the r6 rig button
  11.     TextButton.Parent = dock
  12.     TextButton.BackgroundColor3 = Color3.fromRGB(25, 109, 234)
  13.     TextButton.BorderSizePixel = 0
  14.     TextButton.Position = UDim2.new(0, 0, 0.164911225, 0)
  15.     TextButton.Size = UDim2.new(0.997, 0,0.114, 0)
  16.     TextButton.Font = Enum.Font.SourceSans
  17.     TextButton.Text = "R6"
  18.     TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  19.     TextButton.TextScaled = true
  20.     TextButton.MouseButton1Click:Connect(function()
  21.         local Dummy = Instance.new("Model")
  22.         Dummy.Name = "Dummy"
  23.         Dummy.Parent = workspace.Objects
  24.         local did = addinstance.Add("Model", 0, 1, Dummy) -- as of now addinstance returns the id of the instance
  25.         local head, hrp, la, ll, ra, rl, t -- defining some variables
  26.        
  27.         local humanoid = Instance.new("Humanoid")
  28.         humanoid.Parent = Dummy
  29.         addinstance.Add("Humanoid", 1, did, humanoid) -- (Class, X, id, instance) is the params of Add
  30.        
  31.        
  32.         head = Instance.new("Part")
  33.         head.Name = "Head"
  34.         head.Size = Vector3.new(2, 1, 1)
  35.         head.Position = Vector3.new(0, 4.5, 0)
  36.         head.Parent = Dummy
  37.         --head.CanCollide = false
  38.         local hdid = addinstance.Add("Part", 1, did, head)
  39.        
  40.         hrp = Instance.new("Part")
  41.         hrp.Size = Vector3.new(2, 2, 1)
  42.         hrp.Name = "HumanoidRootPart"
  43.         hrp.Position = Vector3.new(0, 3, 0)
  44.         hrp.Transparency = 1
  45.         hrp.Parent = Dummy
  46.         hrp.Anchored = true
  47.        
  48.         local hrpid = addinstance.Add("Part", 1, did, hrp)
  49.        
  50.         Dummy.PrimaryPart = hrp
  51.        
  52.         la = Instance.new("Part")
  53.         la.Name = "Left Arm"
  54.         la.Size = Vector3.new(1, 2, 1)
  55.         la.Position = Vector3.new(-1.5, 3, 0)
  56.         la.Parent = Dummy
  57.         local laid = addinstance.Add("Part", 1, did, la)
  58.        
  59.         ll = Instance.new("Part")
  60.         ll.Name = "Left Leg"
  61.         ll.Size = Vector3.new(1, 2, 1)
  62.         ll.Parent = Dummy
  63.         local llid = addinstance.Add("Part", 1, did, ll)
  64.        
  65.         ra = Instance.new("Part")
  66.         ra.Name = "Right Arm"
  67.         ra.Size = Vector3.new(1,2,1)
  68.         ra.Position = Vector3.new(1.5, 3, 0)
  69.         ra.Parent = Dummy
  70.         local raid = addinstance.Add("Part", 1, did, ra)
  71.        
  72.         rl = Instance.new("Part")
  73.         rl.Name = "Right Leg"
  74.         rl.Size = Vector3.new(1, 2, 1)
  75.         rl.Position = Vector3.new(0.5, 1, 0)
  76.         rl.Parent = Dummy
  77.        
  78.         local rlid = addinstance.Add("Part", 1, did, rl)
  79.        
  80.         t = Instance.new("Part")
  81.         t.Name = "Torso"
  82.         t.Size = Vector3.new(2, 2, 1)
  83.         t.Position = Vector3.new(0, 3, 0)
  84.         t.Parent = Dummy
  85.        
  86.         local tid = addinstance.Add("Part", 1, did, t)
  87.        
  88.         local roothip = Instance.new("Motor6D")
  89.         roothip.Parent = hrp
  90.         roothip.Name = "Root Hip"
  91.         roothip.MaxVelocity = .1
  92.         roothip.Part0 = hrp
  93.         roothip.Part1 = t
  94.         addinstance.Add("Motor6D", 2, hrpid, roothip) -- this has no children so we don't need to define its id
  95.        
  96.         local Neck = Instance.new("Motor6D")
  97.         Neck.Parent = t
  98.         Neck.Name = "Neck"
  99.         Neck.MaxVelocity = .1
  100.         Neck.Part0 = t
  101.         Neck.Part1 = head
  102.        
  103.         addinstance.Add("Motor6D", 2, tid, Neck)
  104.        
  105.         head.Position = Vector3.new(0, 4.5, 0)
  106.        
  107.         local LH = Instance.new("Motor6D")
  108.         LH.Parent = t
  109.         LH.Name = "Left Hip"
  110.         LH.MaxVelocity = .1
  111.         LH.Part0 = t
  112.         LH.Part1 = ll
  113.  
  114.         addinstance.Add("Motor6D", 2, tid, LH)
  115.        
  116.         ll.Position = Vector3.new(-0.5, 1, 0)
  117.        
  118.         local LS = Instance.new("Motor6D")
  119.         LS.Parent = t
  120.         LS.Name = "Left Shoulder"
  121.         LS.MaxVelocity = .1
  122.         LS.Part0 = t
  123.         LS.Part1 = la
  124.  
  125.         addinstance.Add("Motor6D", 2, tid, LS)
  126.  
  127.         la.Position = Vector3.new(-1.5, 3, 0)
  128.        
  129.         local RS = Instance.new("Motor6D")
  130.         RS.Parent = t
  131.         RS.Name = "Right Shoulder"
  132.         RS.MaxVelocity = .1
  133.         RS.Part0 = t
  134.         RS.Part1 = ra
  135.  
  136.         addinstance.Add("Motor6D", 2, tid, RS)
  137.  
  138.         ra.Position = Vector3.new(1.5, 3, 0)
  139.        
  140.         local RA = Instance.new("Motor6D")
  141.         RA.Parent = t
  142.         RA.Name = "Right Hip"
  143.         RA.MaxVelocity = .1
  144.         RA.Part0 = t
  145.         RA.Part1 = rl
  146.  
  147.         addinstance.Add("Motor6D", 2, tid, RA)
  148.  
  149.         rl.Position = Vector3.new(0.5, 1, 0)
  150.        
  151.        
  152.         addinstance.Add("nil")
  153.        
  154.     end)
  155. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement