dahpiglz

Untitled

Jun 5th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.05 KB | None | 0 0
  1. plr = game.Players.LocalPlayer
  2. mouse = plr:GetMouse()
  3. part = nil
  4. bp = nil
  5. particles = nil
  6. function clerp(a,b,c,d)
  7. for i = 0,d,.01 do
  8. a.CFrame = CFrame.new(b:lerp(c,i))
  9. wait()
  10. end
  11. end
  12. function slerp(a2,b2,c2,d2)
  13. for i2 = 0,d2,.01 do
  14. a2.CFrame = CFrame.new(b2:lerp(c2,i2))
  15. wait()
  16. end
  17. end
  18. mouse.KeyDown:connect(function(key)
  19. if key == "e" and plr.Character.Parent == workspace then
  20.  
  21.  
  22. local PhysicsService = game:GetService("PhysicsService")
  23. local Players = game:GetService("Players")
  24.  
  25. local playerCollisionGroupName = "Players"
  26. PhysicsService:CreateCollisionGroup(playerCollisionGroupName)
  27. PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)
  28.  
  29. local previousCollisionGroups = {}
  30.  
  31. local function setCollisionGroup(object)
  32. if object:IsA("BasePart") then
  33. previousCollisionGroups[object] = object.CollisionGroupId
  34. PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
  35. end
  36. end
  37.  
  38. local function setCollisionGroupRecursive(object)
  39. setCollisionGroup(object)
  40.  
  41. for _, child in ipairs(object:GetChildren()) do
  42. setCollisionGroupRecursive(child)
  43. end
  44. end
  45.  
  46. local function resetCollisionGroup(object)
  47. local previousCollisionGroupId = previousCollisionGroups[object]
  48. if not previousCollisionGroupId then return end
  49.  
  50. local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
  51. if not previousCollisionGroupName then return end
  52.  
  53. PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
  54. previousCollisionGroups[object] = nil
  55. end
  56.  
  57. setCollisionGroupRecursive(plr.Character)
  58.  
  59. plr.Character.DescendantAdded:Connect(setCollisionGroup)
  60. plr.Character.DescendantRemoving:Connect(resetCollisionGroup)
  61.  
  62.  
  63.  
  64.  
  65. plr.Character.Parent = workspace.Camera
  66. plr.Character.Archivable = true
  67. Instance.new("ForceField",plr.Character).Visible = false
  68. for y,t in pairs(plr.Character:GetChildren()) do
  69. if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  70. t.Transparency = 1
  71. if t.Name == "Head" and t:FindFirstChild("face") then
  72. t.face.Transparency = 1
  73. end
  74. elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  75. -- t.Handle.Transparency = 1
  76. end
  77. end
  78. elseif key == "z" and plr.Character.Parent == workspace.Camera and part == nil then
  79. plr.Character.Torso.CFrame = CFrame.new(Vector3.new(mouse.hit.p.X,mouse.hit.p.Y+1.5,mouse.hit.p.Z),plr.Character.Torso.CFrame.p)
  80. elseif key == "x" and plr.Character.Parent == workspace.Camera and part == nil then
  81. if plr.Character.Torso.Anchored == true then
  82. for y,t in pairs(plr.Character:GetChildren()) do
  83. if t:IsA("Part") then
  84. t.Anchored = false
  85. end
  86. end
  87. else
  88. for y,t in pairs(plr.Character:GetChildren()) do
  89. if t:IsA("Part") then
  90. t.Anchored = true
  91. end
  92. end
  93. end
  94. elseif key == "c" and plr.Character.Parent == workspace.Camera and part ~= nil then
  95. local clone = part:Clone()
  96. clone.Parent = workspace
  97. clone.Anchored = false
  98. clone:ClearAllChildren()
  99. clone.CanCollide = true
  100. bp.Parent = clone
  101. particles.Parent = clone
  102. if part.Parent:FindFirstChildOfClass("Humanoid") then
  103. part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
  104. end
  105. part:Destroy()
  106. part = clone
  107. elseif key == "t" and plr.Character.Parent == workspace.Camera and part == nil then
  108. plr.Character.Parent = workspace
  109. plr.Character.Archivable = false
  110. plr.Character:FindFirstChildOfClass("ForceField"):Remove()
  111. for y,t in pairs(plr.Character:GetChildren()) do
  112. if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  113. t.Transparency = 0
  114. if t.Name == "Head" and t:FindFirstChild("face") then
  115. t.face.Transparency = 0
  116. end
  117. elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  118. t.Handle.Transparency = 0
  119. end
  120. end
  121. end
  122. end)
  123. mouse.Button1Down:connect(function()
  124. if plr.Character.Parent == workspace.Camera then
  125. if mouse ~= nil then
  126. if mouse.Target ~= nil then
  127. part = mouse.Target
  128. bp = Instance.new("BodyPosition",part)
  129. bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  130. bp.Position = part.Position
  131. particles = Instance.new("ParticleEmitter",part)
  132. particles.Color = ColorSequence.new(Color3.new(0,0,0))
  133. particles.Size = NumberSequence.new(1)
  134. particles.Texture = "rbxassetid://292289455"
  135. particles.VelocitySpread = 360
  136. particles.Speed = NumberRange.new(0)
  137. particles.RotSpeed = NumberRange.new(0)
  138. particles.Rotation = NumberRange.new(0)
  139. particles.Rate = 250
  140. particles.Lifetime = NumberRange.new(.2,.4)
  141. particles.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(.12,.688,0),NumberSequenceKeypoint.new(.891,.887,0),NumberSequenceKeypoint.new(1,1,0)})
  142. dwn = true
  143. end
  144. end
  145. while dwn == true do
  146. wait()
  147. bp.Position = mouse.hit.p
  148. if part then
  149. if part.Parent:FindFirstChildOfClass("Humanoid") then
  150. part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
  151. end
  152. end
  153. end
  154. end
  155. end)
  156. mouse.Button1Up:connect(function()
  157. dwn = false
  158. if part then if part.Parent:FindFirstChildOfClass("Humanoid") then part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false end part = nil end
  159. if bp then bp:Destroy() end
  160. if particles then particles:Destroy() end
  161. end)
  162. base = Instance.new("ScreenGui",plr.PlayerGui)
  163. bbg = Instance.new("BillboardGui",plr.Character.Head)
  164. bbg.Size = UDim2.new(0,200,0,50)
  165. bbg.StudsOffset = Vector3.new(0,3,0)
  166. bbgTl = Instance.new("TextLabel",bbg)
  167. bbgTl.BackgroundTransparency = 1
  168. bbgTl.Size = UDim2.new(10,0,1,0)
  169. bbgTl.Position = UDim2.new(-4.5,0,0,0)
  170. bbgTl.Font = "Code"
  171. bbgTl.Text = " "
  172. bbgTl.TextSize = 25
  173. bbgTl.TextStrokeColor3 = Color3.new(1,1,1)
  174. bbgTl.TextColor3 = Color3.new(0,0,0)
  175. bbgTl.TextStrokeTransparency = 0
  176. bbgTl.TextWrapped = true
  177. plr.Chatted:connect(function(msg)
  178. bbgTl.Text = msg
  179. wait(5)
  180. if bbgTl.Text == msg then
  181. bbgTl.Text = " "
  182. end
  183. end)
  184. touchCounter = 0
  185. while wait() do
  186. if plr.Character.Parent == workspace.Camera then
  187. local c = plr.Character:Clone()
  188. c:MakeJoints()
  189. for y,t in pairs(c:GetChildren()) do
  190. if t:IsA("Part") then
  191. t.CanCollide = false
  192. t.Anchored = true
  193. t.Transparency = 0
  194. t.TopSurface = "Smooth"
  195. t.BottomSurface = "Smooth"
  196. t.RightSurface = "Smooth"
  197. t.LeftSurface = "Smooth"
  198. t.FrontSurface = "Smooth"
  199. t.BackSurface = "Smooth"
  200. --t.BrickColor = BrickColor.new("Really black")
  201. if t.Name == "Head" and t:FindFirstChild("face") then
  202. t.face.Transparency = 0
  203. elseif t.Name == "Torso" and t:FindFirstChild("roblox") then
  204. --t.roblox:Remove()
  205. elseif t.Name == "HumanoidRootPart" then
  206. t:Remove()
  207. elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  208. t.Handle.Transparency = 0
  209. end
  210. end
  211. end
  212. c.Parent = workspace
  213. game.Debris:AddItem(c,.05)
  214. end
  215. end
Add Comment
Please, Sign In to add comment