Advertisement
teotv202

roblox Minecraft script

Jun 14th, 2019
6,492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. local RealPlayer = Player
  4. do local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  5. print([[
  6. you can only place 9 block
  7. but if you get a error messages
  8. because you can't place unlimited blocks
  9. ]])
  10.  
  11. plr = game.Players.LocalPlayer
  12. repeat wait() until plr.Character
  13. char = plr.Character
  14.  
  15. local humRootPart = char:WaitForChild("HumanoidRootPart")
  16. local head = char:WaitForChild("Head")
  17. local torso = char:WaitForChild("Torso")
  18. local lArm = char:WaitForChild("Left Arm")
  19. local rArm = char:WaitForChild("Right Arm")
  20. local lLeg = char:WaitForChild("Left Leg")
  21. local rLeg = char:WaitForChild("Right Leg")
  22.  
  23. local humanoid = char:WaitForChild("Humanoid")
  24. humanoid.HipHeight = 0.3
  25.  
  26. local rootJoint = Instance.new("Motor6D", torso)
  27. rootJoint.Name = "RootJoint"
  28. rootJoint.Part0 = humRootPart
  29. rootJoint.Part1 = torso
  30. rootJoint.C1 = CFrame.new(0, 0.05, 0)
  31.  
  32. --[[
  33. local neck = Instance.new("Motor6D", torso)
  34. neck.Name = "Neck"
  35. neck.Part0 = head
  36. neck.Part1 = torso
  37. ]]--
  38.  
  39. --[[
  40. local lS = Instance.new("Motor6D", torso)
  41. lS.Name = "Left Shoulder"
  42. lS.Part0 = lArm
  43. lS.Part1 = torso
  44. lS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  45. lS.C1 = CFrame.new(0.65, 0.975, 0)
  46. ]]--
  47.  
  48. local rS = Instance.new("Motor6D", torso)
  49. rS.Name = "Right Shoulder"
  50. rS.Part0 = rArm
  51. rS.Part1 = torso
  52. rS.C0 = CFrame.new(-0.325, 0.975, 0) * CFrame.Angles(0, 0, 0)
  53. rS.C1 = CFrame.new(-0.65, 0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  54.  
  55. local lH = Instance.new("Motor6D", torso)
  56. lH.Name = "Left Hip"
  57. lH.Part0 = lLeg
  58. lH.Part1 = torso
  59. lH.C0 = CFrame.new(0, 0.975, 0)
  60. lH.C1 = CFrame.new(0.325, -0.975, 0) * CFrame.Angles(0, 0, 0)
  61.  
  62. local rH = Instance.new("Motor6D", torso)
  63. rH.Name = "Right Hip"
  64. rH.Part0 = rLeg
  65. rH.Part1 = torso
  66. rH.C0 = CFrame.new(0, 0.975, 0)
  67. rH.C1 = CFrame.new(-0.325, -0.975, 0) * CFrame.Angles(0, -math.rad(180), 0)
  68.  
  69. head.Size = Vector3.new(1.3, 1.3, 1.3)
  70. head:WaitForChild("Mesh"):Destroy()
  71. torso.Size = Vector3.new(1.3, 1.95, 0.65)
  72. lArm.Size = Vector3.new(0.65, 1.95, 0.65)
  73. rArm.Size = Vector3.new(0.65, 1.95, 0.65)
  74. lLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  75. rLeg.Size = Vector3.new(0.65, 1.95, 0.65)
  76.  
  77. char.Humanoid:ClearAllChildren()
  78. char.Animate:Remove()
  79.  
  80. local ticks = 0
  81. local times = 0
  82.  
  83. local walkAnim = 0
  84. local increaseWalkAnim = 1
  85.  
  86. local idleAnimRotX = 0
  87. local idleAnimRotZ = 0
  88. local sneaking = 0
  89.  
  90. local RS = game:GetService("RunService").RenderStepped
  91.  
  92. local oldHP = humanoid.Health
  93. local damageTime = 0
  94.  
  95. local punchRotX = 0
  96. local punchRotY = 0
  97. local punchRotZ = 0
  98. local punchSpeed = 0
  99. local punching = 0
  100. local selectedBlock = 8
  101. local punchEnded = 1
  102. local itemOnHand = nil
  103.  
  104. local handItem = Instance.new("Part", char)
  105. handItem.Name = "HandItem"
  106. handItem.Size = Vector3.new(0.52, 0.52, 0.52)
  107. handItem.Transparency = 1
  108. handItem.CanCollide = false
  109.  
  110. local handItemWeld = Instance.new("Weld", char)
  111. handItemWeld.Part0 = handItem
  112. handItemWeld.Part1 = lArm
  113. handItemWeld.C1 = CFrame.new(0, -0.9, -0.6) * CFrame.Angles(math.rad(-10), math.rad(45), 0)
  114.  
  115. effect = Instance.new("Model",char)
  116. effect.Name = "Effects"
  117. --[[
  118. moozik = Instance.new("Sound",char)
  119. moozik.SoundId = "rbxassetid://132024343"
  120. moozik.Volume = 10
  121. moozik.Looped = true
  122. moozik:Play()
  123. ]]--
  124. hurt = Instance.new("Sound",char)
  125. hurt.SoundId = "rbxassetid://975173739"
  126. hurt.Volume = 10
  127.  
  128.  
  129.  
  130.  
  131. local block = Instance.new("Part",effect)
  132. block.Size = Vector3.new(1,1,1)
  133. block.CanCollide = false
  134. local weld = Instance.new("Weld",block)
  135. weld.Part0 = block
  136. weld.Part1 = char["Right Arm"]
  137. weld.C0 = CFrame.new(-0.00427627563, -0.0187358856, 1.48222256, 1, 0, 0, 0, -0.0125430031, -0.999921381, 0, 0.999921262, -0.0125430049)
  138. local decal1 = Instance.new("Decal",block)
  139. decal1.Face = "Top"
  140. local decal2 = Instance.new("Decal",block)
  141. decal2.Face = "Front"
  142. local decal3 = Instance.new("Decal",block)
  143. decal3.Face = "Bottom"
  144. local decal4 = Instance.new("Decal",block)
  145. decal4.Face = "Back"
  146. local decal5 = Instance.new("Decal",block)
  147. decal5.Face = "Left"
  148. local decal6 = Instance.new("Decal",block)
  149. decal6.Face = "Right"
  150. damaged = false
  151. local reddamage = function(timeofeffect)
  152. for i,v in pairs(char:GetChildren()) do
  153. if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
  154. local cp = v:Clone()
  155. cp.Parent = effect
  156. cp.BrickColor = BrickColor.new("Really red")
  157. cp.Transparency = 0.7
  158. cp.CanCollide = false
  159. cp.Material = Enum.Material.Neon
  160. if cp.Name == "Head" then
  161. cp.face:Destroy()
  162. end
  163. if cp.Name == "Torso" then
  164. cp.roblox:Destroy()
  165. end
  166. if v ~= char.Head then
  167. cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  168. else
  169. cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  170. end
  171. local weld = Instance.new("Weld",cp)
  172. weld.Part0 = v
  173. weld.Part1 = cp
  174. game:GetService("Debris"):AddItem(cp,timeofeffect)
  175. end
  176. end
  177. char.Torso.Velocity = char.Torso.CFrame.lookVector * -100
  178. hurt:Play()
  179. end
  180.  
  181. function changeyourblockdecal(bottom,top,left,right,back,front)
  182. decal3.Texture = bottom
  183. decal1.Texture = top
  184. decal5.Texture = left
  185. decal6.Texture = right
  186. decal4.Texture = back
  187. decal2.Texture = front
  188. end
  189. function changeblockdecal(whatblock , bottom,top,left,right,back,front)
  190. local tex1 = Instance.new("Decal",whatblock)
  191. tex1.Face = "Top"
  192. local tex2 = Instance.new("Decal",whatblock)
  193. tex2.Face = "Front"
  194. local tex3 = Instance.new("Decal",whatblock)
  195. tex3.Face = "Bottom"
  196. local tex4 = Instance.new("Decal",whatblock)
  197. tex4.Face = "Back"
  198. local tex5 = Instance.new("Decal",whatblock)
  199. tex5.Face = "Left"
  200. local tex6 = Instance.new("Decal",whatblock)
  201. tex6.Face = "Right"
  202. tex3.Texture = bottom
  203. tex1.Texture = top
  204. tex5.Texture = left
  205. tex6.Texture = right
  206. tex4.Texture = back
  207. tex2.Texture = front
  208. end
  209. lhand = char.Torso["Left Shoulder"]:Clone()
  210. rhand = char.Torso["Right Shoulder"]:Clone()
  211. local rhandweld = Instance.new("Weld",char)
  212. rhandweld.Part0 = char.Torso
  213. rhandweld.Part1 = char["Right Arm"]
  214. rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  215. local human2 = Instance.new("Weld",char)
  216. human2.Part0 = char.HumanoidRootPart
  217. human2.Part1 = char.Torso
  218. human2co = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  219.  
  220.  
  221. function changeblocktype(whattype)
  222. if whattype == "Grass" then
  223. 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")
  224. end
  225. if whattype == "Dirt" then
  226. 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")
  227. end
  228. if whattype == "Cobblestone" then
  229. 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")
  230. end
  231. if whattype == "Gold" then
  232. 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")
  233. end
  234. if whattype == "Stone" then
  235. 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")
  236. end
  237. if whattype == "DiamondBlock" then
  238. 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")
  239. end
  240. if whattype == "DiamondOre" then
  241. 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")
  242. end
  243. if whattype == "WoodenPlank" then
  244. 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")
  245. end
  246. if whattype == "OakWood" then
  247. 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")
  248. end
  249. if whattype == "GoldOre" then
  250. 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")
  251. end
  252. if whattype == "Sponge" then
  253. 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")
  254. end
  255. end
  256.  
  257. changeblocktype("Grass")
  258.  
  259.  
  260.  
  261. function playanim(whatanim,speed)
  262. if whatanim == "Place" then
  263. rhandweld.Parent = char.Torso
  264. for i = 0,1, speed do
  265. 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)
  266. game:GetService("RunService").RenderStepped:wait()
  267. end
  268. for i = 0,1, speed do
  269. 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)
  270. game:GetService("RunService").RenderStepped:wait()
  271. end
  272. end
  273. if whatanim == "Destroy" then
  274. rhandweld.Parent = char.Torso
  275. for i = 0,1, speed do
  276. 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)
  277. game:GetService("RunService").RenderStepped:wait()
  278. end
  279. for i = 0,1, speed do
  280. 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)
  281. game:GetService("RunService").RenderStepped:wait()
  282. end
  283. end
  284. if whatanim == "NormalPose" then
  285. for i = 0,1 , speed do
  286. 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)
  287. game:GetService("RunService").RenderStepped:wait()
  288. end
  289. end
  290. end
  291. canuse = true
  292. mouse = plr:GetMouse()
  293. function buildblock()
  294. if canuse then
  295. canuse = false
  296. playanim("Place", 0.07)
  297. local theactualblock = Instance.new("Part",workspace)
  298. theactualblock:BreakJoints()
  299. theactualblock.Parent = workspace
  300. theactualblock.Transparency = 0
  301. theactualblock.CFrame = mouse.Hit + Vector3.new(0,1.09,0)
  302. theactualblock.Orientation = Vector3.new(0,0,0)
  303. theactualblock.Size = Vector3.new(3,3,3)
  304. theactualblock.Anchored = true
  305. theactualblock.CanCollide = true
  306. theactualblock.Name = "BlockPlace"
  307. changeblockdecal(theactualblock,decal3.Texture, decal1.Texture, decal5.Texture,decal6.Texture, decal4.Texture, decal2.Texture)
  308. playanim("NormalPose", 0.3)
  309. canuse = true
  310. end
  311. end
  312. function destroyblock()
  313. if mouse.Target.Name == "BlockPlace" and mouse.Target.Name ~= "Base" and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Workspace" then
  314. playanim("Destroy", 0.07)
  315. mouse.Target:Destroy()
  316. playanim("NormalPose", 0.3)
  317. end
  318. end
  319. local mouse1 = mouse.Button1Down:connect(function()
  320. buildblock()
  321. end)
  322. local mouse2 = mouse.KeyDown:connect(function(k)
  323. if k == "q" then
  324. destroyblock()
  325. end
  326. if k == "e" then
  327. local chance = math.random(1,11)
  328. if chance == 1 then
  329. changeblocktype("Grass")
  330. end
  331. if chance == 2 then
  332. changeblocktype("Dirt")
  333. end
  334. if chance == 3 then
  335. changeblocktype("Cobblestone")
  336. end
  337. if chance == 4 then
  338. changeblocktype("Gold")
  339. end
  340. if chance == 5 then
  341. changeblocktype("Stone")
  342. end
  343. if chance == 6 then
  344. changeblocktype("DiamondBlock")
  345. end
  346. if chance == 7 then
  347. changeblocktype("DiamondOre")
  348. end
  349. if chance == 8 then
  350. changeblocktype("WoodenPlank")
  351. end
  352. if chance == 9 then
  353. changeblocktype("OakWood")
  354. end
  355. if chance == 10 then
  356. changeblocktype("GoldOre")
  357. end
  358. if chance == 11 then
  359. changeblocktype("Sponge")
  360. end
  361. end
  362. end)
  363. HasDied = false
  364. Dead = false
  365. local reddeath = function()
  366. for i,v in pairs(char:GetChildren()) do
  367. if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
  368. local cp = v:Clone()
  369. cp.Parent = effect
  370. cp.BrickColor = BrickColor.new("Really red")
  371. cp.Transparency = 1
  372. cp.CanCollide = false
  373. cp.Material = Enum.Material.Neon
  374. if cp.Name == "Head" then
  375. cp.face:Destroy()
  376. end
  377. if cp.Name == "Torso" then
  378. cp.roblox:Destroy()
  379. end
  380. if v ~= char.Head then
  381. cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  382. else
  383. cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  384. end
  385. local weld = Instance.new("Weld",cp)
  386. weld.Part0 = v
  387. weld.Part1 = cp
  388. end
  389. end
  390. end
  391. reddeath()
  392. --generategui = function()
  393. local BODY = {}
  394. LeftArm = char["Left Arm"]
  395. RightLeg = char["Right Leg"]
  396. LeftLeg = char["Left Leg"]
  397. for _, c in pairs(char:GetDescendants()) do
  398. if c:IsA("BasePart") and c.Name ~= "Handle" then
  399. 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
  400. c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
  401. end
  402. table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency})
  403. elseif c:IsA("JointInstance") then
  404. table.insert(BODY,{c,c.Parent,nil,nil,nil})
  405. end
  406. end
  407. for e = 1, #BODY do
  408. if BODY[e] ~= nil then
  409. local STUFF = BODY[e]
  410. local PART = STUFF[1]
  411. local PARENT = STUFF[2]
  412. local MATERIAL = STUFF[3]
  413. local TRANSPARENCY = STUFF[5]
  414. if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
  415. PART.Material = MATERIAL
  416. PART.Transparency = TRANSPARENCY
  417. end
  418. PART.AncestryChanged:Connect(function()
  419. PART.Parent = PARENT
  420. end)
  421. end
  422. end
  423. function refit()
  424. char.Parent = workspace
  425. for e = 1, #BODY do
  426. if BODY[e] ~= nil then
  427. local STUFF = BODY[e]
  428. local PART = STUFF[1]
  429. local PARENT = STUFF[2]
  430. local MATERIAL = STUFF[3]
  431. local TRANSPARENCY = STUFF[5]
  432. if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
  433. PART.Material = MATERIAL
  434. PART.Transparency = TRANSPARENCY
  435. end
  436. if PART.Parent ~= PARENT then
  437. char:FindFirstChildOfClass("Humanoid"):remove()
  438. PART.Parent = PARENT
  439. Humanoid = Instance.new("Humanoid",char)
  440. end
  441. end
  442. end
  443. end
  444. char.Humanoid.Died:connect(function()
  445. hurt:Play()
  446. refit()
  447. mouse1:Disconnect()
  448. mouse2:Disconnect()
  449. plr:LoadCharacter()
  450. for i,v in pairs(effect:GetChildren()) do
  451. if v.ClassName == "Part" then
  452. v.Transparency = 0.7
  453. end
  454. end
  455. workspace.CurrentCamera.CameraSubject = char.Head
  456. generategui()
  457. HasDied = true
  458. Dead = true
  459. for i = 0,1, 0.03 do
  460. 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)
  461. game:GetService("RunService").RenderStepped:wait()
  462. end
  463. end)
  464. while true do
  465. game:GetService("RunService").RenderStepped:wait()
  466. if char.Humanoid.Health < 100 and not damaged and not Dead and not HasDied then
  467. reddamage(0.5)
  468. damaged = true
  469. wait(1)
  470. damaged = false
  471. char.Humanoid.Health = 100
  472. end
  473. if char.Humanoid.Health < 1 and Dead and HasDied then
  474. refit()
  475. for i,v in pairs(effect:GetChildren()) do
  476. if v.ClassName == "Part" then
  477. v.Transparency = 0.7
  478. end
  479. end
  480. end
  481. if Dead and HasDied then
  482. char.Humanoid.WalkSpeed = 0
  483. char.Humanoid.JumpPower = 0
  484. human2.Parent = char.Torso
  485. rhandweld.Parent = char.Torso
  486. end
  487. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement