Advertisement
lafur

Untitled

Feb 8th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. plr = game.Players.timetodie23232223
  2. repeat wait() until plr.Character
  3. char = plr.Character
  4.  
  5. effect = Instance.new("Model",char)
  6. effect.Name = "Effects"
  7.  
  8.  
  9. moozik = Instance.new("Sound",char)
  10. moozik.SoundId = "rbxassetid://132024343"
  11. moozik.Volume = 10
  12. moozik.Looped = true
  13. moozik:Play()
  14. hurt = Instance.new("Sound",char)
  15. hurt.SoundId = "rbxassetid://975173739"
  16. hurt.Volume = 10
  17.  
  18.  
  19.  
  20.  
  21. local block = Instance.new("Part",effect)
  22. block.Size = Vector3.new(1,1,1)
  23. block.CanCollide = false
  24. local weld = Instance.new("Weld",block)
  25. weld.Part0 = block
  26. weld.Part1 = char["Right Arm"]
  27. weld.C0 = CFrame.new(-0.00427627563, -0.0187358856, 1.48222256, 1, 0, 0, 0, -0.0125430031, -0.999921381, 0, 0.999921262, -0.0125430049)
  28. local decal1 = Instance.new("Decal",block)
  29. decal1.Face = "Top"
  30. local decal2 = Instance.new("Decal",block)
  31. decal2.Face = "Front"
  32. local decal3 = Instance.new("Decal",block)
  33. decal3.Face = "Bottom"
  34. local decal4 = Instance.new("Decal",block)
  35. decal4.Face = "Back"
  36. local decal5 = Instance.new("Decal",block)
  37. decal5.Face = "Left"
  38. local decal6 = Instance.new("Decal",block)
  39. decal6.Face = "Right"
  40. damaged = false
  41. local reddamage = function(timeofeffect)
  42. for i,v in pairs(char:GetChildren()) do
  43. if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
  44. local cp = v:Clone()
  45. cp.Parent = effect
  46. cp.BrickColor = BrickColor.new("Really red")
  47. cp.Transparency = 0.7
  48. cp.CanCollide = false
  49. cp.Material = Enum.Material.Neon
  50. if cp.Name == "Head" then
  51. cp.face:Destroy()
  52. end
  53. if cp.Name == "Torso" then
  54. cp.roblox:Destroy()
  55. end
  56. if v ~= char.Head then
  57. cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  58. else
  59. cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  60. end
  61. local weld = Instance.new("Weld",cp)
  62. weld.Part0 = v
  63. weld.Part1 = cp
  64. game:GetService("Debris"):AddItem(cp,timeofeffect)
  65. end
  66. end
  67. char.Torso.Velocity = char.Torso.CFrame.lookVector * -100
  68. hurt:Play()
  69. end
  70.  
  71. function changeyourblockdecal(bottom,top,left,right,back,front)
  72. decal3.Texture = bottom
  73. decal1.Texture = top
  74. decal5.Texture = left
  75. decal6.Texture = right
  76. decal4.Texture = back
  77. decal2.Texture = front
  78. end
  79. function changeblockdecal(whatblock , bottom,top,left,right,back,front)
  80. local tex1 = Instance.new("Decal",whatblock)
  81. tex1.Face = "Top"
  82. local tex2 = Instance.new("Decal",whatblock)
  83. tex2.Face = "Front"
  84. local tex3 = Instance.new("Decal",whatblock)
  85. tex3.Face = "Bottom"
  86. local tex4 = Instance.new("Decal",whatblock)
  87. tex4.Face = "Back"
  88. local tex5 = Instance.new("Decal",whatblock)
  89. tex5.Face = "Left"
  90. local tex6 = Instance.new("Decal",whatblock)
  91. tex6.Face = "Right"
  92. tex3.Texture = bottom
  93. tex1.Texture = top
  94. tex5.Texture = left
  95. tex6.Texture = right
  96. tex4.Texture = back
  97. tex2.Texture = front
  98. end
  99. lhand = char.Torso["Left Shoulder"]:Clone()
  100. rhand = char.Torso["Right Shoulder"]:Clone()
  101. local rhandweld = Instance.new("Weld",char)
  102. rhandweld.Part0 = char.Torso
  103. rhandweld.Part1 = char["Right Arm"]
  104. rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  105. local human2 = Instance.new("Weld",char)
  106. human2.Part0 = char.HumanoidRootPart
  107. human2.Part1 = char.Torso
  108. human2co = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  109.  
  110.  
  111. function changeblocktype(whattype)
  112. if whattype == "Grass" then
  113. changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96430265","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337")
  114. end
  115. if whattype == "Dirt" then
  116. changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755")
  117. end
  118. if whattype == "Cobblestone" then
  119. changeyourblockdecal("http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377")
  120. end
  121. if whattype == "Gold" then
  122. changeyourblockdecal("http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851")
  123. end
  124. if whattype == "Stone" then
  125. changeyourblockdecal("http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261")
  126. end
  127. if whattype == "DiamondBlock" then
  128. changeyourblockdecal("http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371")
  129. end
  130. if whattype == "DiamondOre" then
  131. changeyourblockdecal("http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647")
  132. end
  133. if whattype == "WoodenPlank" then
  134. changeyourblockdecal("http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036")
  135. end
  136. if whattype == "OakWood" then
  137. changeyourblockdecal("http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786")
  138. end
  139. if whattype == "GoldOre" then
  140. changeyourblockdecal("http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646")
  141. end
  142. if whattype == "Sponge" then
  143. changeyourblockdecal("http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383")
  144. end
  145. end
  146.  
  147. changeblocktype("Grass")
  148.  
  149.  
  150.  
  151. function playanim(whatanim,speed)
  152. if whatanim == "Place" then
  153. rhandweld.Parent = char.Torso
  154. for i = 0,1, speed do
  155. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i)
  156. game:GetService("RunService").RenderStepped:wait()
  157. end
  158. for i = 0,1, speed do
  159. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i)
  160. game:GetService("RunService").RenderStepped:wait()
  161. end
  162. end
  163. if whatanim == "Destroy" then
  164. rhandweld.Parent = char.Torso
  165. for i = 0,1, speed do
  166. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i)
  167. game:GetService("RunService").RenderStepped:wait()
  168. end
  169. for i = 0,1, speed do
  170. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i)
  171. game:GetService("RunService").RenderStepped:wait()
  172. end
  173. end
  174. if whatanim == "NormalPose" then
  175. for i = 0,1 , speed do
  176. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1),i)
  177. game:GetService("RunService").RenderStepped:wait()
  178. end
  179. end
  180. end
  181. canuse = true
  182. mouse = plr:GetMouse()
  183. function buildblock()
  184. if canuse then
  185. canuse = false
  186. playanim("Place", 0.07)
  187. local theactualblock = Instance.new("Part")
  188. theactualblock:BreakJoints()
  189. theactualblock.Parent = workspace
  190. theactualblock.Transparency = 0
  191. theactualblock.CFrame = mouse.Hit + Vector3.new(0,1.09,0)
  192. theactualblock.Orientation = Vector3.new(0,0,0)
  193. theactualblock.Size = Vector3.new(3,3,3)
  194. theactualblock.Anchored = true
  195. theactualblock.CanCollide = true
  196. theactualblock.Name = "BlockPlace"
  197. changeblockdecal(theactualblock,decal3.Texture, decal1.Texture, decal5.Texture,decal6.Texture, decal4.Texture, decal2.Texture)
  198. playanim("NormalPose", 0.3)
  199. canuse = true
  200. end
  201. end
  202. function destroyblock()
  203. if mouse.Target.Name == "BlockPlace" and mouse.Target.Name ~= "Base" and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Workspace" then
  204. playanim("Destroy", 0.07)
  205. mouse.Target:Destroy()
  206. playanim("NormalPose", 0.3)
  207. end
  208. end
  209. local mouse1 = mouse.Button1Down:connect(function()
  210. buildblock()
  211. end)
  212. local mouse2 = mouse.KeyDown:connect(function(k)
  213. if k == "q" then
  214. destroyblock()
  215. end
  216. if k == "e" then
  217. local chance = math.random(1,11)
  218. if chance == 1 then
  219. changeblocktype("Grass")
  220. end
  221. if chance == 2 then
  222. changeblocktype("Dirt")
  223. end
  224. if chance == 3 then
  225. changeblocktype("Cobblestone")
  226. end
  227. if chance == 4 then
  228. changeblocktype("Gold")
  229. end
  230. if chance == 5 then
  231. changeblocktype("Stone")
  232. end
  233. if chance == 6 then
  234. changeblocktype("DiamondBlock")
  235. end
  236. if chance == 7 then
  237. changeblocktype("DiamondOre")
  238. end
  239. if chance == 8 then
  240. changeblocktype("WoodenPlank")
  241. end
  242. if chance == 9 then
  243. changeblocktype("OakWood")
  244. end
  245. if chance == 10 then
  246. changeblocktype("GoldOre")
  247. end
  248. if chance == 11 then
  249. changeblocktype("Sponge")
  250. end
  251. end
  252. end)
  253. HasDied = false
  254. Dead = false
  255. local reddeath = function()
  256. for i,v in pairs(char:GetChildren()) do
  257. if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
  258. local cp = v:Clone()
  259. cp.Parent = effect
  260. cp.BrickColor = BrickColor.new("Really red")
  261. cp.Transparency = 1
  262. cp.CanCollide = false
  263. cp.Material = Enum.Material.Neon
  264. if cp.Name == "Head" then
  265. cp.face:Destroy()
  266. end
  267. if cp.Name == "Torso" then
  268. cp.roblox:Destroy()
  269. end
  270. if v ~= char.Head then
  271. cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  272. else
  273. cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  274. end
  275. local weld = Instance.new("Weld",cp)
  276. weld.Part0 = v
  277. weld.Part1 = cp
  278. end
  279. end
  280. end
  281. reddeath()
  282. generategui = function()
  283. local screen = Instance.new("ScreenGui",plr.PlayerGui)
  284. screen.Name = "Death(lol i was lazy to add buttons lol)"
  285. local text = Instance.new("TextLabel",screen)
  286. text.Text = "You died!"
  287. text.TextColor3 = Color3.new(1,1,1)
  288. text.Font = "Arcade"
  289. text.TextScaled = true
  290. text.Position = UDim2.new(0.381, 0,0.172, 0)
  291. text.Size = UDim2.new(0, 200, 0, 50)
  292. text.BackgroundTransparency = 1
  293. local respawn = Instance.new("TextButton",screen)
  294. respawn.Text = "Respawn"
  295. respawn.TextScaled = true
  296. respawn.Position = UDim2.new(0.381, 0,0.561, 0)
  297. respawn.Size = UDim2.new(0, 200,0, 50)
  298. respawn.BackgroundTransparency = 1
  299. respawn.TextColor3 = Color3.new(1,1,1)
  300. respawn.Font = "Arcade"
  301. respawn.MouseButton1Click:connect(function()
  302. Dead = false
  303. HasDied = false
  304. char.Humanoid.Health = 0
  305. char.Parent = nil
  306. respawn.Text = "Say g/r or g/sr to respawn properly"
  307. end)
  308. end
  309. local BODY = {}
  310. LeftArm = char["Left Arm"]
  311. RightLeg = char["Right Leg"]
  312. LeftLeg = char["Left Leg"]
  313. for _, c in pairs(char:GetDescendants()) do
  314. if c:IsA("BasePart") and c.Name ~= "Handle" then
  315. if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
  316. c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
  317. end
  318. table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency})
  319. elseif c:IsA("JointInstance") then
  320. table.insert(BODY,{c,c.Parent,nil,nil,nil})
  321. end
  322. end
  323. for e = 1, #BODY do
  324. if BODY[e] ~= nil then
  325. local STUFF = BODY[e]
  326. local PART = STUFF[1]
  327. local PARENT = STUFF[2]
  328. local MATERIAL = STUFF[3]
  329. local TRANSPARENCY = STUFF[5]
  330. if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
  331. PART.Material = MATERIAL
  332. PART.Transparency = TRANSPARENCY
  333. end
  334. PART.AncestryChanged:Connect(function()
  335. PART.Parent = PARENT
  336. end)
  337. end
  338. end
  339. function refit()
  340. char.Parent = workspace
  341. for e = 1, #BODY do
  342. if BODY[e] ~= nil then
  343. local STUFF = BODY[e]
  344. local PART = STUFF[1]
  345. local PARENT = STUFF[2]
  346. local MATERIAL = STUFF[3]
  347. local TRANSPARENCY = STUFF[5]
  348. if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
  349. PART.Material = MATERIAL
  350. PART.Transparency = TRANSPARENCY
  351. end
  352. if PART.Parent ~= PARENT then
  353. char:FindFirstChildOfClass("Humanoid"):remove()
  354. PART.Parent = PARENT
  355. Humanoid = Instance.new("Humanoid",char)
  356. end
  357. end
  358. end
  359. end
  360. char.Humanoid.Died:connect(function()
  361. hurt:Play()
  362. refit()
  363. mouse1:Disconnect()
  364. mouse2:Disconnect()
  365. for i,v in pairs(effect:GetChildren()) do
  366. if v.ClassName == "Part" then
  367. v.Transparency = 0.7
  368. end
  369. end
  370. workspace.CurrentCamera.CameraSubject = char.Head
  371. generategui()
  372. HasDied = true
  373. Dead = true
  374. for i = 0,1, 0.03 do
  375. human2.C0 = human2.C0:lerp(CFrame.new(1.99999964, -3.00000095, 0, -0.00852799695, 0.999963641, 0, -0.999963641, -0.00852799695, 0, 0, 0, 1):inverse() + Vector3.new(0,1,0),i)
  376. game:GetService("RunService").RenderStepped:wait()
  377. end
  378. end)
  379. while true do
  380. game:GetService("RunService").RenderStepped:wait()
  381. if char.Humanoid.Health < 100 and not damaged and not Dead and not HasDied then
  382. reddamage(0.5)
  383. damaged = true
  384. wait(1)
  385. damaged = false
  386. char.Humanoid.Health = 100
  387. end
  388. if char.Humanoid.Health < 1 and Dead and HasDied then
  389. refit()
  390. for i,v in pairs(effect:GetChildren()) do
  391. if v.ClassName == "Part" then
  392. v.Transparency = 0.7
  393. end
  394. end
  395. end
  396. if Dead and HasDied then
  397. char.Humanoid.WalkSpeed = 0
  398. char.Humanoid.JumpPower = 0
  399. human2.Parent = char.Torso
  400. rhandweld.Parent = char.Torso
  401. end
  402. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement