Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pluginService = require(game.ReplicatedStorage.PluginsService)
- script.Parent.MouseButton1Click:Connect(function()
- local dockinfo = pluginService.DockWindowInfo.new("Floating", true, false, UDim2.new(0.2, 0,0.438, 0)) -- this creates a dockinfo
- local dock = pluginService:CreateDockWindow("Rig Builder", dockinfo) -- creates a dockwindow
- local main = dock.Parent.Parent
- local addinstance = require(main.Explorer.AddInstance)
- dock.BackgroundColor3 = Color3.new(0.262745, 0.262745, 0.262745)
- dock.BackgroundTransparency = .5
- local TextButton = Instance.new("TextButton") -- the r6 rig button
- TextButton.Parent = dock
- TextButton.BackgroundColor3 = Color3.fromRGB(25, 109, 234)
- TextButton.BorderSizePixel = 0
- TextButton.Position = UDim2.new(0, 0, 0.164911225, 0)
- TextButton.Size = UDim2.new(0.997, 0,0.114, 0)
- TextButton.Font = Enum.Font.SourceSans
- TextButton.Text = "R6"
- TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- TextButton.TextScaled = true
- TextButton.MouseButton1Click:Connect(function()
- local Dummy = Instance.new("Model")
- Dummy.Name = "Dummy"
- Dummy.Parent = workspace.Objects
- local did = addinstance.Add("Model", 0, 1, Dummy) -- as of now addinstance returns the id of the instance
- local head, hrp, la, ll, ra, rl, t -- defining some variables
- local humanoid = Instance.new("Humanoid")
- humanoid.Parent = Dummy
- addinstance.Add("Humanoid", 1, did, humanoid) -- (Class, X, id, instance) is the params of Add
- head = Instance.new("Part")
- head.Name = "Head"
- head.Size = Vector3.new(2, 1, 1)
- head.Position = Vector3.new(0, 4.5, 0)
- head.Parent = Dummy
- --head.CanCollide = false
- local hdid = addinstance.Add("Part", 1, did, head)
- hrp = Instance.new("Part")
- hrp.Size = Vector3.new(2, 2, 1)
- hrp.Name = "HumanoidRootPart"
- hrp.Position = Vector3.new(0, 3, 0)
- hrp.Transparency = 1
- hrp.Parent = Dummy
- hrp.Anchored = true
- local hrpid = addinstance.Add("Part", 1, did, hrp)
- Dummy.PrimaryPart = hrp
- la = Instance.new("Part")
- la.Name = "Left Arm"
- la.Size = Vector3.new(1, 2, 1)
- la.Position = Vector3.new(-1.5, 3, 0)
- la.Parent = Dummy
- local laid = addinstance.Add("Part", 1, did, la)
- ll = Instance.new("Part")
- ll.Name = "Left Leg"
- ll.Size = Vector3.new(1, 2, 1)
- ll.Parent = Dummy
- local llid = addinstance.Add("Part", 1, did, ll)
- ra = Instance.new("Part")
- ra.Name = "Right Arm"
- ra.Size = Vector3.new(1,2,1)
- ra.Position = Vector3.new(1.5, 3, 0)
- ra.Parent = Dummy
- local raid = addinstance.Add("Part", 1, did, ra)
- rl = Instance.new("Part")
- rl.Name = "Right Leg"
- rl.Size = Vector3.new(1, 2, 1)
- rl.Position = Vector3.new(0.5, 1, 0)
- rl.Parent = Dummy
- local rlid = addinstance.Add("Part", 1, did, rl)
- t = Instance.new("Part")
- t.Name = "Torso"
- t.Size = Vector3.new(2, 2, 1)
- t.Position = Vector3.new(0, 3, 0)
- t.Parent = Dummy
- local tid = addinstance.Add("Part", 1, did, t)
- local roothip = Instance.new("Motor6D")
- roothip.Parent = hrp
- roothip.Name = "Root Hip"
- roothip.MaxVelocity = .1
- roothip.Part0 = hrp
- roothip.Part1 = t
- addinstance.Add("Motor6D", 2, hrpid, roothip) -- this has no children so we don't need to define its id
- local Neck = Instance.new("Motor6D")
- Neck.Parent = t
- Neck.Name = "Neck"
- Neck.MaxVelocity = .1
- Neck.Part0 = t
- Neck.Part1 = head
- addinstance.Add("Motor6D", 2, tid, Neck)
- head.Position = Vector3.new(0, 4.5, 0)
- local LH = Instance.new("Motor6D")
- LH.Parent = t
- LH.Name = "Left Hip"
- LH.MaxVelocity = .1
- LH.Part0 = t
- LH.Part1 = ll
- addinstance.Add("Motor6D", 2, tid, LH)
- ll.Position = Vector3.new(-0.5, 1, 0)
- local LS = Instance.new("Motor6D")
- LS.Parent = t
- LS.Name = "Left Shoulder"
- LS.MaxVelocity = .1
- LS.Part0 = t
- LS.Part1 = la
- addinstance.Add("Motor6D", 2, tid, LS)
- la.Position = Vector3.new(-1.5, 3, 0)
- local RS = Instance.new("Motor6D")
- RS.Parent = t
- RS.Name = "Right Shoulder"
- RS.MaxVelocity = .1
- RS.Part0 = t
- RS.Part1 = ra
- addinstance.Add("Motor6D", 2, tid, RS)
- ra.Position = Vector3.new(1.5, 3, 0)
- local RA = Instance.new("Motor6D")
- RA.Parent = t
- RA.Name = "Right Hip"
- RA.MaxVelocity = .1
- RA.Part0 = t
- RA.Part1 = rl
- addinstance.Add("Motor6D", 2, tid, RA)
- rl.Position = Vector3.new(0.5, 1, 0)
- addinstance.Add("nil")
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement