Advertisement
-----------------

C4 reupload

May 11th, 2021
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.46 KB | None | 0 0
  1. print([[
  2. = defusal bomb made by KrYn0MoRe =
  3. - Unique modules to solve
  4. - Teamwork can be done
  5. - 1 mistake and you're out
  6. ]])
  7.  
  8. local plr = owner
  9. local char = plr.Character
  10. local hum = char:FindFirstChildOfClass("Humanoid")
  11. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  12.  
  13. debris = game:GetService("Debris")
  14. tween = game:GetService("TweenService")
  15.  
  16. local ToolEquipped = false
  17. local holding = false
  18. local equipped = false
  19. local using = false
  20.  
  21. local Tool0 = Instance.new("Tool")
  22. local Part1 = Instance.new("Part")
  23. local SpecialMesh2 = Instance.new("SpecialMesh")
  24. Tool0.Name = "C4"
  25. Tool0.Parent = plr['Backpack']
  26. Tool0.TextureId = "rbxassetid://172171690"
  27. Tool0.Grip = CFrame.new(-0.600610614, -0.169408143, -8.8817842e-16, -0.808358014, 7.02007208e-09, -0.588691175, -0.588691175, -9.6395727e-09, 0.808358014, 0, 1, 1.19248806e-08)
  28. Tool0.ToolTip = "Plant the bomb, complete the objective."
  29. Part1.Name = "Handle"
  30. Part1.Parent = Tool0
  31. Part1.CFrame = CFrame.new(0.0049970001, 0.340999991, -0.00151099998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  32. Part1.Position = Vector3.new(0.0049970001, 0.340999991, -0.00151099998)
  33. Part1.Size = Vector3.new(1.59000003, 0.681999981, 2.26300001)
  34. Part1.BottomSurface = Enum.SurfaceType.Smooth
  35. Part1.TopSurface = Enum.SurfaceType.Smooth
  36. SpecialMesh2.Parent = Part1
  37. SpecialMesh2.MeshId = "rbxassetid://454801145"
  38. SpecialMesh2.Scale = Vector3.new(0.00200000009, 0.00200000009, 0.00200000009)
  39. SpecialMesh2.TextureId = "rbxassetid://454801149"
  40. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  41.  
  42. local handle = Part1
  43. local tool = Tool0
  44.  
  45. local equip = Instance.new("Sound",handle)
  46. equip.SoundId = "rbxassetid://169799883"
  47. equip.Volume = 1
  48.  
  49. local planting = Instance.new("Sound",handle)
  50. planting.SoundId = "rbxassetid://340617924"
  51. planting.Volume = 1
  52.  
  53. local planted = Instance.new("Sound",script)
  54. planted.SoundId = "rbxassetid://180746510"
  55. planted.Volume = 2
  56.  
  57. local modules = {}
  58. local themes = {1837828275,1842961789,1837828288,1839549205,1839549180}
  59. local defuse_dist = 6
  60. local max_time = 60*1.5
  61. local completed_modules = 0
  62. local total_modules = 0
  63. local countdown = max_time
  64. local mistake = false
  65.  
  66. function ex_fx(item)
  67. local Gate
  68. local function hit(hit)
  69. if hit then
  70. local Effect = Instance.new("SelectionBox",script)
  71. if item.Visible then
  72. Effect.Color3 = Color3.fromRGB(255,150,0)
  73. Effect.SurfaceColor3 = Color3.fromRGB(255,215,0)
  74. Effect.Transparency = 0.67
  75. Effect.SurfaceTransparency = 0.73
  76. else
  77. Effect.Color3 = Color3.fromRGB(0,100,255)
  78. Effect.SurfaceColor3 = Color3.fromRGB(0,60,215)
  79. Effect.Transparency = 0.8
  80. Effect.SurfaceTransparency = 0.9
  81. end
  82. Effect.Adornee = hit
  83. Effect.Archivable = false
  84. game:GetService("Debris"):AddItem(Effect,math.random(150,350) / 100)
  85. end
  86. end
  87. item.Hit:connect(hit)
  88. wait()
  89. if item.Visible == false then
  90. Gate = false
  91. else
  92. Gate = true
  93. end
  94. local EffectPart = Instance.new("Part",script)
  95. EffectPart.Archivable = false
  96. EffectPart.Size = Vector3.new(0.125,0.125,0.125)
  97. EffectPart.CanCollide = false
  98. EffectPart.Anchored = true
  99. EffectPart.Archivable = false
  100. EffectPart.Locked = true
  101. EffectPart.CFrame = CFrame.new(0,0,0)
  102. EffectPart.Name = "Effect"
  103. EffectPart.Material = Enum.Material.Neon
  104. EffectPart.Transparency = 0.25
  105. EffectPart.BrickColor = BrickColor.new("Neon orange")
  106. EffectPart.TopSurface = Enum.SurfaceType.Unjoinable
  107. EffectPart.BottomSurface = Enum.SurfaceType.Unjoinable
  108. EffectPart.LeftSurface = Enum.SurfaceType.Unjoinable
  109. EffectPart.RightSurface = Enum.SurfaceType.Unjoinable
  110. EffectPart.FrontSurface = Enum.SurfaceType.Unjoinable
  111. EffectPart.BackSurface = Enum.SurfaceType.Unjoinable
  112. local Effect = Instance.new("SpecialMesh")
  113. Effect.Parent = EffectPart
  114. Effect.MeshType = Enum.MeshType.Sphere
  115. Effect.Offset = Vector3.new(item.Position.X,item.Position.Y,item.Position.Z)
  116. local Attachment = Instance.new("Attachment",EffectPart)
  117. Attachment.Position = Vector3.new(item.Position.X,item.Position.Y,item.Position.Z)
  118. local Alternate = true
  119. for i = 1,20 do
  120. wait(0.02)
  121. Alternate = not Alternate
  122. if EffectPart then
  123. if Alternate then
  124. if Gate then
  125. EffectPart.Transparency = 0
  126. EffectPart.BrickColor = BrickColor.new("Cool yellow")
  127. else
  128. EffectPart.Transparency = 0.6
  129. EffectPart.BrickColor = BrickColor.new("Cyan")
  130. end
  131. else
  132. if Gate then
  133. EffectPart.Transparency = 0.25
  134. EffectPart.BrickColor = BrickColor.new("Neon orange")
  135. else
  136. EffectPart.Transparency = 0.8
  137. EffectPart.BrickColor = BrickColor.new("Bright blue")
  138. end
  139. end
  140. end
  141. if Effect then
  142. game:GetService("TweenService"):Create(Effect,TweenInfo.new(0.02),{
  143. Scale = Vector3.new(item.BlastRadius * (0.8 * i),item.BlastRadius * (0.8 * i),item.BlastRadius * (0.8 * i))
  144. }):Play()
  145. end
  146. end
  147. for i = 1,10 do
  148. wait(0.007)
  149. Alternate = not Alternate
  150. if EffectPart then
  151. if Alternate then
  152. if Gate then
  153. EffectPart.Transparency = 0
  154. EffectPart.BrickColor = BrickColor.new("Neon orange")
  155. else
  156. EffectPart.Transparency = 0.7
  157. EffectPart.BrickColor = BrickColor.new("Bright blue")
  158. end
  159. else
  160. if Gate then
  161. EffectPart.Transparency = 0.25
  162. EffectPart.BrickColor = BrickColor.new("Bright red")
  163. else
  164. EffectPart.Transparency = 0.8
  165. EffectPart.BrickColor = BrickColor.new("Navy blue")
  166. end
  167. end
  168. end
  169. if Effect then
  170. game:GetService("TweenService"):Create(Effect,TweenInfo.new(0.007),{
  171. Scale = Vector3.new(item.BlastRadius * (16 - (1.6 * i)),item.BlastRadius * (16 - (1.6 * i)),item.BlastRadius * (16 - (1.6 * i)))
  172. }):Play()
  173. end
  174. end
  175. if EffectPart then
  176. EffectPart:Destroy()
  177. end
  178. end
  179.  
  180. function limb_collide(obj,mode)
  181. if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
  182. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  183. if not exists then
  184. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  185. end
  186. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  187. --
  188. local t = {}
  189. --
  190. local cb = Instance.new("Part")
  191. cb.Name = 'limb'
  192. cb.Transparency = 1
  193. cb.CanCollide = true
  194. cb.Anchored = false
  195. cb.CFrame = obj.CFrame
  196. cb.Size = obj.Size
  197. cb.Massless = true
  198. cb.Locked = true
  199. game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  200. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  201. local weld = Instance.new("Weld")
  202. weld.Part0 = cb
  203. weld.Part1 = obj
  204. weld.Parent = cb
  205. obj.Massless = true
  206. obj.Anchored = false
  207. if mode or obj:FindFirstChild("Dismembered") then
  208. cb.Parent = obj -- .Parent
  209. else
  210. cb.Parent = script
  211. table.insert(t,1,cb)
  212. end
  213. --
  214. if not string.match(obj.Name:lower(),'torso') and not string.match(obj.Name:lower(),'rootpart') and not string.match(obj.Name:lower(),'head') then
  215. local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
  216. local cb2 = Instance.new("Part")
  217. cb2.Name = 'limb'
  218. cb2.Transparency = 1
  219. cb2.CanCollide = true
  220. cb2.Anchored = false
  221. cb2.CFrame = obj.CFrame
  222. cb2.Size = lv
  223. cb2.Massless = true
  224. cb2.Locked = true
  225. local weld2 = Instance.new("Weld")
  226. weld2.Part0 = cb
  227. weld2.Part1 = cb2
  228. weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
  229. weld2.Parent = cb2
  230. if mode or obj:FindFirstChild("Dismembered") then
  231. cb2.Parent = obj -- .Parent
  232. else
  233. cb2.Parent = script
  234. table.insert(t,1,cb2)
  235. end
  236. end
  237. --
  238. return t
  239. end
  240. function Ragdoll(targchar,headless,insta,kill)
  241. local pc = targchar
  242. local targhum = pc:FindFirstChild("Humanoid")
  243. local js,js2 = {},{}
  244. for _,obj in pairs(pc:GetDescendants()) do
  245. if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
  246. obj.Massless = true
  247. obj.Locked = true
  248. end
  249. end
  250. if kill == true then
  251. pc.Archivable = true
  252. local old_pc = pc
  253. pc = pc:Clone()
  254. for i,v in pairs(pc:GetDescendants()) do
  255. limb_collide(v,true)
  256. if v:IsA("ParticleEmitter") then
  257. v.Enabled = false
  258. end
  259. if v:IsA("SelectionBox") or v:IsA("BodyVelocity") or v:IsA("BodyPosition") or v:IsA("BodyAngularVelocity") or v:IsA("BodyForce") or v:IsA("BodyGyro") or v:IsA("BodyThrust") or v:IsA("BodyMover") then
  260. if v:IsA("BodyVelocity") then
  261. game:GetService("Debris"):AddItem(v,0.15)
  262. else
  263. v:Destroy()
  264. end
  265. end
  266. if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
  267. v:Destroy()
  268. end
  269. if v:IsA("Humanoid") then
  270. v.BreakJointsOnDeath = false
  271. v.Health = 0
  272. v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  273. v.PlatformStand = true
  274. end
  275. end
  276. for i,v in pairs(old_pc:GetDescendants()) do
  277. if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("ForceField") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") or v:IsA("SurfaceGui") then
  278. v:destroy()
  279. end
  280. if v:IsA("Humanoid") then
  281. v.BreakJointsOnDeath = true
  282. v.Health = 0
  283. v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  284. v.PlatformStand = true
  285. end
  286. end
  287. pc.Parent = workspace
  288. game:GetService("Debris"):AddItem(pc,15)
  289. end
  290. if pc ~= nil then
  291. local hum = pc:FindFirstChild'Humanoid'
  292. local LArm = pc:FindFirstChild'Left Arm'
  293. local RArm = pc:FindFirstChild'Right Arm'
  294. local LLeg = pc:FindFirstChild'Left Leg'
  295. local RLeg = pc:FindFirstChild'Right Leg'
  296. local torso = pc:FindFirstChild'Torso'
  297. local head = pc:FindFirstChild'Head'
  298.  
  299.  
  300. local LUA = pc:FindFirstChild'LeftUpperArm'
  301. local LLA = pc:FindFirstChild'LeftLowerArm'
  302. local LH = pc:FindFirstChild'LeftHand'
  303.  
  304. local RUA = pc:FindFirstChild'RightUpperArm'
  305. local RLA = pc:FindFirstChild'RightLowerArm'
  306. local RH = pc:FindFirstChild'RightHand'
  307.  
  308. local LUL = pc:FindFirstChild'LeftUpperLeg'
  309. local LLL = pc:FindFirstChild'LeftLowerLeg'
  310. local LF = pc:FindFirstChild'LeftFoot'
  311.  
  312. local RUL = pc:FindFirstChild'RightUpperLeg'
  313. local RLL = pc:FindFirstChild'RightLowerLeg'
  314. local RF = pc:FindFirstChild'RightFoot'
  315.  
  316. local UT = pc:FindFirstChild'UpperTorso'
  317. local LT = pc:FindFirstChild'LowerTorso'
  318.  
  319. if hum and LArm and RArm and LLeg and RLeg and head then
  320. hum.BreakJointsOnDeath = false
  321. if insta then
  322. if hum.RigType==Enum.HumanoidRigType.R6 then
  323. for _,v in pairs(torso:GetDescendants()) do
  324. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  325. if not kill then
  326. table.insert(js2,1,{obj = v,par = v.Parent})
  327. v.Parent = nil
  328. elseif kill then
  329. v:Destroy()
  330. end
  331. end
  332. end
  333. local vis = false
  334. local vis2 = false
  335. if LArm and not LArm:FindFirstChild('Dismembered') then
  336. local at1 = Instance.new("Attachment")
  337. at1.Parent = torso
  338. at1.Visible = vis
  339. at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  340. at1.Position = Vector3.new(-1,1,0)
  341.  
  342. local at1p2 = Instance.new("Attachment")
  343. at1p2.Parent = LArm
  344. at1p2.Visible = vis
  345. at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  346. at1p2.Position = Vector3.new(.5,1,0)
  347.  
  348. local bis = Instance.new("BallSocketConstraint")
  349. bis.Parent = LArm
  350. bis.Attachment0 = at1
  351. bis.Attachment1 = at1p2
  352. bis.LimitsEnabled = true
  353. bis.UpperAngle = 15
  354. bis.Visible = vis2
  355. bis.TwistLimitsEnabled = true
  356. bis.UpperAngle = -45
  357. bis.TwistLowerAngle = -45
  358. table.insert(js,1,bis)
  359. end
  360. if RArm and not RArm:FindFirstChild('Dismembered') then
  361. local at2 = Instance.new("Attachment")
  362. at2.Parent = torso
  363. at2.Visible = vis
  364. at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  365. at2.Position = Vector3.new(1,1,0)
  366.  
  367. local at2p2 = Instance.new("Attachment")
  368. at2p2.Parent = RArm
  369. at2p2.Visible = vis
  370. at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  371. at2p2.Position = Vector3.new(-.5,1,0)
  372.  
  373. local bis2 = Instance.new("BallSocketConstraint")
  374. bis2.Parent = RArm
  375. bis2.Attachment0 = at2
  376. bis2.Attachment1 = at2p2
  377. bis2.LimitsEnabled = true
  378. bis2.UpperAngle = 15
  379. bis2.Visible = vis2
  380. bis2.TwistLimitsEnabled = true
  381. bis2.UpperAngle = -45
  382. bis2.TwistLowerAngle = -45
  383. table.insert(js,1,bis2)
  384. end
  385. if RLeg and not RLeg:FindFirstChild('Dismembered') then
  386. local at3 = Instance.new("Attachment")
  387. at3.Parent = torso
  388. at3.Visible = vis
  389. at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  390. at3.Position = Vector3.new(.5,-1,0)
  391.  
  392. local at3p2 = Instance.new("Attachment")
  393. at3p2.Parent = RLeg
  394. at3p2.Visible = vis
  395. at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  396. at3p2.Position = Vector3.new(0,1,0)
  397.  
  398. local bis3 = Instance.new("BallSocketConstraint")
  399. bis3.Parent = RLeg
  400. bis3.Attachment0 = at3
  401. bis3.Attachment1 = at3p2
  402. bis3.LimitsEnabled = true
  403. bis3.UpperAngle = 180-15
  404. bis3.Visible = vis2
  405. table.insert(js,1,bis3)
  406. end
  407.  
  408. if LLeg and not LLeg:FindFirstChild('Dismembered') then
  409. local at4 = Instance.new("Attachment")
  410. at4.Parent = torso
  411. at4.Visible = vis
  412. at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  413. at4.Position = Vector3.new(-.5,-1,0)
  414.  
  415. local at4p2 = Instance.new("Attachment")
  416. at4p2.Parent = LLeg
  417. at4p2.Visible = vis
  418. at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  419. at4p2.Position = Vector3.new(0,1,0)
  420.  
  421. local bis4 = Instance.new("BallSocketConstraint")
  422. bis4.Parent = LLeg
  423. bis4.Attachment0 = at4
  424. bis4.Attachment1 = at4p2
  425. bis4.LimitsEnabled = true
  426. bis4.UpperAngle = 180-15
  427. bis4.Visible = vis2
  428. table.insert(js,1,bis4)
  429. end
  430.  
  431. if head and not headless and not head:FindFirstChild('Dismembered') then
  432. local at5 = Instance.new("Attachment")
  433. at5.Parent = torso
  434. at5.Visible = vis
  435. at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  436. at5.Position = Vector3.new(0,1,0)
  437.  
  438. local at5p2 = Instance.new("Attachment")
  439. at5p2.Parent = head
  440. at5p2.Visible = vis
  441. at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  442. at5p2.Position = Vector3.new(0,-.5,0)
  443.  
  444. local bis5 = Instance.new("BallSocketConstraint")
  445. bis5.Parent = head
  446. bis5.Attachment0 = at5p2
  447. bis5.Attachment1 = at5
  448. bis5.LimitsEnabled = true
  449. bis5.UpperAngle = 75
  450. bis5.Visible = vis2
  451. bis5.TwistLimitsEnabled = true
  452. bis5.UpperAngle = -45
  453. bis5.TwistLowerAngle = -45
  454. table.insert(js,1,bis5)
  455. else
  456. --head:BreakJoints()
  457. end
  458. end
  459. else
  460. hum.Died:Connect(function()
  461. if hum.RigType==Enum.HumanoidRigType.R6 then
  462. for _,v in pairs(torso:GetDescendants()) do
  463. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  464. if not kill then
  465. table.insert(js2,1,{obj = v,par = v.Parent})
  466. v.Parent = nil
  467. elseif kill then
  468. v:Destroy()
  469. end
  470. end
  471. end
  472. local vis = false
  473. local vis2 = false
  474. if LArm and not LArm:FindFirstChild('Dismembered') then
  475. local at1 = Instance.new("Attachment")
  476. at1.Parent = torso
  477. at1.Visible = vis
  478. at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  479. at1.Position = Vector3.new(-1,1,0)
  480.  
  481. local at1p2 = Instance.new("Attachment")
  482. at1p2.Parent = LArm
  483. at1p2.Visible = vis
  484. at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  485. at1p2.Position = Vector3.new(.5,1,0)
  486.  
  487. local bis = Instance.new("BallSocketConstraint")
  488. bis.Parent = LArm
  489. bis.Attachment0 = at1
  490. bis.Attachment1 = at1p2
  491. bis.LimitsEnabled = true
  492. bis.UpperAngle = 15
  493. bis.Visible = vis2
  494. bis.TwistLimitsEnabled = true
  495. bis.UpperAngle = -45
  496. bis.TwistLowerAngle = -45
  497. table.insert(js,1,bis)
  498. end
  499. if RArm and not RArm:FindFirstChild('Dismembered') then
  500. local at2 = Instance.new("Attachment")
  501. at2.Parent = torso
  502. at2.Visible = vis
  503. at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  504. at2.Position = Vector3.new(1,1,0)
  505.  
  506. local at2p2 = Instance.new("Attachment")
  507. at2p2.Parent = RArm
  508. at2p2.Visible = vis
  509. at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  510. at2p2.Position = Vector3.new(-.5,1,0)
  511.  
  512. local bis2 = Instance.new("BallSocketConstraint")
  513. bis2.Parent = RArm
  514. bis2.Attachment0 = at2
  515. bis2.Attachment1 = at2p2
  516. bis2.LimitsEnabled = true
  517. bis2.UpperAngle = 15
  518. bis2.Visible = vis2
  519. bis2.TwistLimitsEnabled = true
  520. bis2.UpperAngle = -45
  521. bis2.TwistLowerAngle = -45
  522. table.insert(js,1,bis2)
  523. end
  524. if RLeg and not RLeg:FindFirstChild('Dismembered') then
  525. local at3 = Instance.new("Attachment")
  526. at3.Parent = torso
  527. at3.Visible = vis
  528. at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  529. at3.Position = Vector3.new(.5,-1,0)
  530.  
  531. local at3p2 = Instance.new("Attachment")
  532. at3p2.Parent = RLeg
  533. at3p2.Visible = vis
  534. at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  535. at3p2.Position = Vector3.new(0,1,0)
  536.  
  537. local bis3 = Instance.new("BallSocketConstraint")
  538. bis3.Parent = RLeg
  539. bis3.Attachment0 = at3
  540. bis3.Attachment1 = at3p2
  541. bis3.LimitsEnabled = true
  542. bis3.UpperAngle = 180-15
  543. bis3.Visible = vis2
  544. table.insert(js,1,bis3)
  545. end
  546.  
  547. if LLeg and not LLeg:FindFirstChild('Dismembered') then
  548. local at4 = Instance.new("Attachment")
  549. at4.Parent = torso
  550. at4.Visible = vis
  551. at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  552. at4.Position = Vector3.new(-.5,-1,0)
  553.  
  554. local at4p2 = Instance.new("Attachment")
  555. at4p2.Parent = LLeg
  556. at4p2.Visible = vis
  557. at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  558. at4p2.Position = Vector3.new(0,1,0)
  559.  
  560. local bis4 = Instance.new("BallSocketConstraint")
  561. bis4.Parent = LLeg
  562. bis4.Attachment0 = at4
  563. bis4.Attachment1 = at4p2
  564. bis4.LimitsEnabled = true
  565. bis4.UpperAngle = 180-15
  566. bis4.Visible = vis2
  567. table.insert(js,1,bis4)
  568. end
  569.  
  570. if head and not headless and not head:FindFirstChild('Dismembered') then
  571. local at5 = Instance.new("Attachment")
  572. at5.Parent = torso
  573. at5.Visible = vis
  574. at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  575. at5.Position = Vector3.new(0,1,0)
  576.  
  577. local at5p2 = Instance.new("Attachment")
  578. at5p2.Parent = head
  579. at5p2.Visible = vis
  580. at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  581. at5p2.Position = Vector3.new(0,-.5,0)
  582.  
  583. local bis5 = Instance.new("BallSocketConstraint")
  584. bis5.Parent = head
  585. bis5.Attachment0 = at5p2
  586. bis5.Attachment1 = at5
  587. bis5.LimitsEnabled = true
  588. bis5.UpperAngle = 75
  589. bis5.Visible = vis2
  590. bis5.TwistLimitsEnabled = true
  591. bis5.UpperAngle = -45
  592. bis5.TwistLowerAngle = -45
  593. table.insert(js,1,bis5)
  594. else
  595. --head:BreakJoints()
  596. end
  597. end
  598. end)
  599. end
  600. elseif head and hum then
  601. hum.BreakJointsOnDeath = false
  602. if insta then
  603. if hum.RigType==Enum.HumanoidRigType.R15 then
  604. for _,v in pairs(pc:GetDescendants()) do
  605. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  606. if not kill then
  607. table.insert(js2,1,{obj = v,par = v.Parent})
  608. v.Parent = nil
  609. elseif kill then
  610. v:Destroy()
  611. end
  612. end
  613. end
  614. local vis = false
  615. local vis2 = false
  616.  
  617. if LF and not LF:FindFirstChild('Dismembered') then
  618. local bsc1 = Instance.new("BallSocketConstraint",LF)
  619. bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  620. bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  621. table.insert(js,1,bsc1)
  622. end
  623. if LLL and not LLL:FindFirstChild('Dismembered') then
  624. local bsc2 = Instance.new("BallSocketConstraint",LLL)
  625. bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  626. bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  627. table.insert(js,1,bsc2)
  628. end
  629. if LUL and not LUL:FindFirstChild('Dismembered') then
  630. local bsc3 = Instance.new("BallSocketConstraint",LUL)
  631. bsc3.Attachment0 = LUL.LeftHipRigAttachment
  632. bsc3.Attachment1 = LT.LeftHipRigAttachment
  633. table.insert(js,1,bsc3)
  634. end
  635. if RF and not RF:FindFirstChild('Dismembered') then
  636. local bsc4 = Instance.new("BallSocketConstraint",RF)
  637. bsc4.Attachment0 = RF.RightAnkleRigAttachment
  638. bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  639. table.insert(js,1,bsc4)
  640. end
  641. if RLL and not RLL:FindFirstChild('Dismembered') then
  642. local bsc5 = Instance.new("BallSocketConstraint",RLL)
  643. bsc5.Attachment0 = RLL.RightKneeRigAttachment
  644. bsc5.Attachment1 = RUL.RightKneeRigAttachment
  645. table.insert(js,1,bsc5)
  646. end
  647. if RUL and not RUL:FindFirstChild('Dismembered') then
  648. local bsc6 = Instance.new("BallSocketConstraint",RUL)
  649. bsc6.Attachment0 = RUL.RightHipRigAttachment
  650. bsc6.Attachment1 = LT.RightHipRigAttachment
  651. table.insert(js,1,bsc6)
  652. end
  653. if LH and not LH:FindFirstChild('Dismembered') then
  654. local bsc7 = Instance.new("BallSocketConstraint",LH)
  655. bsc7.Attachment0 = LH.LeftWristRigAttachment
  656. bsc7.Attachment1 = LLA.LeftWristRigAttachment
  657. table.insert(js,1,bsc7)
  658. end
  659. if LLA and not LLA:FindFirstChild('Dismembered') then
  660. local bsc8 = Instance.new("BallSocketConstraint",LLA)
  661. bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  662. bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  663. table.insert(js,1,bsc8)
  664. end
  665. if LUA and not LUA:FindFirstChild('Dismembered') then
  666. local bsc9 = Instance.new("BallSocketConstraint",LUA)
  667. bsc9.Attachment0 = LUA.LeftShoulderAttachment
  668. bsc9.Attachment1 = UT.LeftCollarAttachment
  669. table.insert(js,1,bsc9)
  670. end
  671. if RH and not RH:FindFirstChild('Dismembered') then
  672. local bsc10 = Instance.new("BallSocketConstraint",RH)
  673. bsc10.Attachment0 = RH.RightWristRigAttachment
  674. bsc10.Attachment1 = RLA.RightWristRigAttachment
  675. table.insert(js,1,bsc10)
  676. end
  677. if RLA and not RLA:FindFirstChild('Dismembered') then
  678. local bsc11 = Instance.new("BallSocketConstraint",RLA)
  679. bsc11.Attachment0 = RLA.RightElbowRigAttachment
  680. bsc11.Attachment1 = RUA.RightElbowRigAttachment
  681. table.insert(js,1,bsc11)
  682. end
  683. if RUA and not RUA:FindFirstChild('Dismembered') then
  684. local bsc12 = Instance.new("BallSocketConstraint",RUA)
  685. bsc12.Attachment0 = RUA.RightShoulderAttachment
  686. bsc12.Attachment1 = UT.RightCollarAttachment
  687. table.insert(js,1,bsc12)
  688. end
  689. if LT and not LT:FindFirstChild('Dismembered') then
  690. local bsc13 = Instance.new("BallSocketConstraint",LT)
  691. bsc13.Attachment0 = LT.WaistRigAttachment
  692. bsc13.Attachment1 = UT.WaistRigAttachment
  693. table.insert(js,1,bsc13)
  694. end
  695. if head and not headless and not head:FindFirstChild('Dismembered') then
  696. local bsc14 = Instance.new("BallSocketConstraint",head)
  697. bsc14.Attachment0 = UT.NeckRigAttachment
  698. bsc14.Attachment1 = head.NeckRigAttachment
  699. bsc14.LimitsEnabled = true
  700. bsc14.UpperAngle = -75
  701. bsc14.TwistLimitsEnabled = true
  702. bsc14.UpperAngle = -45
  703. bsc14.TwistLowerAngle = -45
  704. table.insert(js,1,bsc14)
  705. else
  706. --head:BreakJoints()
  707. end
  708. end
  709. else
  710. hum.Died:Connect(function()
  711. if hum.RigType==Enum.HumanoidRigType.R15 then
  712. for _,v in pairs(pc:GetDescendants()) do
  713. if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  714. if not kill then
  715. table.insert(js2,1,{obj = v,par = v.Parent})
  716. v.Parent = nil
  717. elseif kill then
  718. v:Destroy()
  719. end
  720. end
  721. end
  722. local vis = false
  723. local vis2 = false
  724.  
  725. if LF and not LF:FindFirstChild('Dismembered') then
  726. local bsc1 = Instance.new("BallSocketConstraint",LF)
  727. bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  728. bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  729. table.insert(js,1,bsc1)
  730. end
  731. if LLL and not LLL:FindFirstChild('Dismembered') then
  732. local bsc2 = Instance.new("BallSocketConstraint",LLL)
  733. bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  734. bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  735. table.insert(js,1,bsc2)
  736. end
  737. if LUL and not LUL:FindFirstChild('Dismembered') then
  738. local bsc3 = Instance.new("BallSocketConstraint",LUL)
  739. bsc3.Attachment0 = LUL.LeftHipRigAttachment
  740. bsc3.Attachment1 = LT.LeftHipRigAttachment
  741. table.insert(js,1,bsc3)
  742. end
  743. if RF and not RF:FindFirstChild('Dismembered') then
  744. local bsc4 = Instance.new("BallSocketConstraint",RF)
  745. bsc4.Attachment0 = RF.RightAnkleRigAttachment
  746. bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  747. table.insert(js,1,bsc4)
  748. end
  749. if RLL and not RLL:FindFirstChild('Dismembered') then
  750. local bsc5 = Instance.new("BallSocketConstraint",RLL)
  751. bsc5.Attachment0 = RLL.RightKneeRigAttachment
  752. bsc5.Attachment1 = RUL.RightKneeRigAttachment
  753. table.insert(js,1,bsc5)
  754. end
  755. if RUL and not RUL:FindFirstChild('Dismembered') then
  756. local bsc6 = Instance.new("BallSocketConstraint",RUL)
  757. bsc6.Attachment0 = RUL.RightHipRigAttachment
  758. bsc6.Attachment1 = LT.RightHipRigAttachment
  759. table.insert(js,1,bsc6)
  760. end
  761. if LH and not LH:FindFirstChild('Dismembered') then
  762. local bsc7 = Instance.new("BallSocketConstraint",LH)
  763. bsc7.Attachment0 = LH.LeftWristRigAttachment
  764. bsc7.Attachment1 = LLA.LeftWristRigAttachment
  765. table.insert(js,1,bsc7)
  766. end
  767. if LLA and not LLA:FindFirstChild('Dismembered') then
  768. local bsc8 = Instance.new("BallSocketConstraint",LLA)
  769. bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  770. bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  771. table.insert(js,1,bsc8)
  772. end
  773. if LUA and not LUA:FindFirstChild('Dismembered') then
  774. local bsc9 = Instance.new("BallSocketConstraint",LUA)
  775. bsc9.Attachment0 = LUA.LeftShoulderAttachment
  776. bsc9.Attachment1 = UT.LeftCollarAttachment
  777. table.insert(js,1,bsc9)
  778. end
  779. if RH and not RH:FindFirstChild('Dismembered') then
  780. local bsc10 = Instance.new("BallSocketConstraint",RH)
  781. bsc10.Attachment0 = RH.RightWristRigAttachment
  782. bsc10.Attachment1 = RLA.RightWristRigAttachment
  783. table.insert(js,1,bsc10)
  784. end
  785. if RLA and not RLA:FindFirstChild('Dismembered') then
  786. local bsc11 = Instance.new("BallSocketConstraint",RLA)
  787. bsc11.Attachment0 = RLA.RightElbowRigAttachment
  788. bsc11.Attachment1 = RUA.RightElbowRigAttachment
  789. table.insert(js,1,bsc11)
  790. end
  791. if RUA and not RUA:FindFirstChild('Dismembered') then
  792. local bsc12 = Instance.new("BallSocketConstraint",RUA)
  793. bsc12.Attachment0 = RUA.RightShoulderAttachment
  794. bsc12.Attachment1 = UT.RightCollarAttachment
  795. table.insert(js,1,bsc12)
  796. end
  797. if LT and not LT:FindFirstChild('Dismembered') then
  798. local bsc13 = Instance.new("BallSocketConstraint",LT)
  799. bsc13.Attachment0 = LT.WaistRigAttachment
  800. bsc13.Attachment1 = UT.WaistRigAttachment
  801. table.insert(js,1,bsc13)
  802. end
  803. if head and not headless and not head:FindFirstChild('Dismembered') then
  804. local bsc14 = Instance.new("BallSocketConstraint",head)
  805. bsc14.Attachment0 = UT.NeckRigAttachment
  806. bsc14.Attachment1 = head.NeckRigAttachment
  807. bsc14.LimitsEnabled = true
  808. bsc14.UpperAngle = -75
  809. bsc14.TwistLimitsEnabled = true
  810. bsc14.UpperAngle = -45
  811. bsc14.TwistLowerAngle = -45
  812. table.insert(js,1,bsc14)
  813. else
  814. --head:BreakJoints()
  815. end
  816. end
  817. end)
  818. end
  819. end
  820. end
  821. return js,js2
  822. end
  823. local blood_images = {931617584,1663434319,1391189545,4533673847,3236192667,2565888666,612591729,120362139,116830967,122022304,131339257,247766282,121678640,176677800,120361912,176678070,176678086,176677869} --305296807,256293532,148713503,176678030
  824.  
  825. local e_s = 1
  826.  
  827. function add_decal(f,t,obj)
  828. spawn(function()
  829. local texture = Instance.new("Texture")
  830. texture.Parent = obj
  831. texture.Face = f
  832. texture.Texture = 'rbxassetid://' .. t
  833. if f == 'Left' or f == 'Right' then
  834. texture.StudsPerTileV = obj.Size.Y + e_s
  835. if (obj.Size.X > obj.Size.Z) then
  836. texture.StudsPerTileV = obj.Size.Z + e_s
  837. elseif (obj.Size.Z > obj.Size.X) then
  838. texture.StudsPerTileU = obj.Size.X + e_s
  839. else
  840. texture.StudsPerTileU = obj.Size.X + e_s
  841. end
  842. elseif f == 'Front' or f == 'Back' then
  843. texture.StudsPerTileV = obj.Size.Y + e_s
  844. if (obj.Size.X > obj.Size.Z) then
  845. texture.StudsPerTileV = obj.Size.X + e_s
  846. elseif (obj.Size.Z > obj.Size.X) then
  847. texture.StudsPerTileU = obj.Size.Z + e_s
  848. else
  849. texture.StudsPerTileU = obj.Size.X + e_s
  850. end
  851. elseif f == 'Top' or f == 'Bottom' then
  852. texture.StudsPerTileV = obj.Size.X + e_s
  853. texture.StudsPerTileU = obj.Size.Z + e_s
  854. end
  855. end)
  856. end
  857.  
  858. function add_blood(obj)
  859. local t1,t2,t3,t4,t5,t6 = blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)]
  860. add_decal('Top',t1,obj)
  861. add_decal('Bottom',t2,obj)
  862. add_decal('Left',t3,obj)
  863. add_decal('Right',t4,obj)
  864. add_decal('Front',t5,obj)
  865. add_decal('Back',t6,obj)
  866. end
  867.  
  868. function make_bone(obj,targtorso)
  869. if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
  870. local bone = Instance.new("Part")
  871. bone.name = 'bone'
  872. bone.CanCollide = false
  873. bone.Anchored = false
  874. bone.CFrame = targtorso.CFrame
  875. bone.Size = targtorso.Size
  876. bone.Massless = true
  877. bone.Locked = true
  878. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  879. if not exists then
  880. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  881. end
  882. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  883. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  884. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  885. local weld = Instance.new("Weld")
  886. weld.Part0 = bone
  887. weld.Part1 = targtorso
  888. weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
  889. weld.Parent = bone
  890. targtorso.Anchored = false
  891. bone.Parent = script
  892. local mesh = Instance.new("SpecialMesh")
  893. mesh.MeshId = 'rbxassetid://1076136382'
  894. mesh.TextureId = 'rbxassetid://1076137938'
  895. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  896. mesh.Parent = bone
  897. --
  898. local bone = Instance.new("Part")
  899. bone.Name = 'bone'
  900. bone.CanCollide = false
  901. bone.Anchored = false
  902. bone.CFrame = obj.CFrame
  903. bone.Size = obj.Size
  904. bone.Massless = true
  905. bone.Locked = true
  906. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  907. if not exists then
  908. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  909. end
  910. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  911. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  912. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  913. local weld = Instance.new("Weld")
  914. weld.Part0 = bone
  915. weld.Part1 = obj
  916. weld.C1 = CFrame.new(0.13,0.26,0)
  917. weld.Parent = bone
  918. obj.Anchored = false
  919. bone.Parent = script
  920. local mesh = Instance.new("SpecialMesh")
  921. mesh.MeshId = 'rbxassetid://36780032'
  922. mesh.TextureId = 'rbxassetid://36780292'
  923. mesh.Parent = bone
  924. elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
  925. local bone = Instance.new("Part")
  926. bone.Name = 'bone'
  927. bone.CanCollide = false
  928. bone.Anchored = false
  929. bone.CFrame = targtorso.CFrame
  930. bone.Size = targtorso.Size
  931. bone.Massless = true
  932. bone.Locked = true
  933. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  934. if not exists then
  935. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  936. end
  937. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  938. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  939. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  940. local weld = Instance.new("Weld")
  941. weld.Part0 = bone
  942. weld.Part1 = targtorso
  943. weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
  944. weld.Parent = bone
  945. targtorso.Anchored = false
  946. bone.Parent = script
  947. local mesh = Instance.new("SpecialMesh")
  948. mesh.MeshId = 'rbxassetid://1076136382'
  949. mesh.TextureId = 'rbxassetid://1076137938'
  950. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  951. mesh.Parent = bone
  952. --
  953. local bone = Instance.new("Part")
  954. bone.Name = 'bone'
  955. bone.CanCollide = false
  956. bone.Anchored = false
  957. bone.CFrame = obj.CFrame
  958. bone.Size = obj.Size
  959. bone.Massless = true
  960. bone.Locked = true
  961. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  962. if not exists then
  963. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  964. end
  965. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  966. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  967. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  968. local weld = Instance.new("Weld")
  969. weld.Part0 = bone
  970. weld.Part1 = obj
  971. weld.C1 = CFrame.new(-0.13,0.26,0)
  972. weld.Parent = bone
  973. obj.Anchored = false
  974. bone.Parent = script
  975. local mesh = Instance.new("SpecialMesh")
  976. mesh.MeshId = 'rbxassetid://36780156'
  977. mesh.TextureId = 'rbxassetid://36780292'
  978. mesh.Parent = bone
  979. elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
  980. local bone = Instance.new("Part")
  981. bone.Name = 'bone'
  982. bone.CanCollide = false
  983. bone.Anchored = false
  984. bone.CFrame = targtorso.CFrame
  985. bone.Size = targtorso.Size
  986. bone.Massless = true
  987. bone.Locked = true
  988. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  989. if not exists then
  990. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  991. end
  992. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  993. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  994. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  995. local weld = Instance.new("Weld")
  996. weld.Part0 = bone
  997. weld.Part1 = targtorso
  998. weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  999. weld.Parent = bone
  1000. targtorso.Anchored = false
  1001. bone.Parent = script
  1002. local mesh = Instance.new("SpecialMesh")
  1003. mesh.MeshId = 'rbxassetid://1076136382'
  1004. mesh.TextureId = 'rbxassetid://1076137938'
  1005. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1006. mesh.Parent = bone
  1007. --
  1008. local bone = Instance.new("Part")
  1009. bone.Name = 'bone'
  1010. bone.CanCollide = false
  1011. bone.Anchored = false
  1012. bone.CFrame = obj.CFrame
  1013. bone.Size = obj.Size
  1014. bone.Massless = true
  1015. bone.Locked = true
  1016. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1017. if not exists then
  1018. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1019. end
  1020. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1021. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1022. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1023. local weld = Instance.new("Weld")
  1024. weld.Part0 = bone
  1025. weld.Part1 = obj
  1026. weld.C1 = CFrame.new(0,0.09,0.13)
  1027. weld.Parent = bone
  1028. obj.Anchored = false
  1029. bone.Parent = script
  1030. local mesh = Instance.new("SpecialMesh")
  1031. mesh.MeshId = 'rbxassetid://36780156'
  1032. mesh.TextureId = 'rbxassetid://36780292'
  1033. mesh.Parent = bone
  1034. elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
  1035. local bone = Instance.new("Part")
  1036. bone.Name = 'bone'
  1037. bone.CanCollide = false
  1038. bone.Anchored = false
  1039. bone.CFrame = targtorso.CFrame
  1040. bone.Size = targtorso.Size
  1041. bone.Massless = true
  1042. bone.Locked = true
  1043. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1044. if not exists then
  1045. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1046. end
  1047. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1048. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1049. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1050. local weld = Instance.new("Weld")
  1051. weld.Part0 = bone
  1052. weld.Part1 = targtorso
  1053. weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  1054. weld.Parent = bone
  1055. targtorso.Anchored = false
  1056. bone.Parent = script
  1057. local mesh = Instance.new("SpecialMesh")
  1058. mesh.MeshId = 'rbxassetid://1076136382'
  1059. mesh.TextureId = 'rbxassetid://1076137938'
  1060. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1061. mesh.Parent = bone
  1062. --
  1063. local bone = Instance.new("Part")
  1064. bone.Name = 'bone'
  1065. bone.CanCollide = false
  1066. bone.Anchored = false
  1067. bone.CFrame = obj.CFrame
  1068. bone.Size = obj.Size
  1069. bone.Massless = true
  1070. bone.Locked = true
  1071. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1072. if not exists then
  1073. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1074. end
  1075. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1076. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1077. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1078. local weld = Instance.new("Weld")
  1079. weld.Part0 = bone
  1080. weld.Part1 = obj
  1081. weld.C1 = CFrame.new(0,0.09,0.13)
  1082. weld.Parent = bone
  1083. obj.Anchored = false
  1084. bone.Parent = script
  1085. local mesh = Instance.new("SpecialMesh")
  1086. mesh.MeshId = 'rbxassetid://36780195'
  1087. mesh.TextureId = 'rbxassetid://36780292'
  1088. mesh.Parent = bone
  1089. elseif obj.Name == 'Head' then
  1090. local bone = Instance.new("Part")
  1091. bone.Name = 'bone'
  1092. bone.CanCollide = false
  1093. bone.Anchored = false
  1094. bone.CFrame = targtorso.CFrame
  1095. bone.Size = targtorso.Size
  1096. bone.Massless = true
  1097. bone.Locked = true
  1098. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1099. if not exists then
  1100. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1101. end
  1102. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1103. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1104. game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1105. local weld = Instance.new("Weld")
  1106. weld.Part0 = bone
  1107. weld.Part1 = targtorso
  1108. weld.C1 = CFrame.new(0,0.66,0)
  1109. weld.Parent = bone
  1110. targtorso.Anchored = false
  1111. bone.Parent = script
  1112. local mesh = Instance.new("SpecialMesh")
  1113. mesh.MeshId = 'rbxassetid://1076136382'
  1114. mesh.TextureId = 'rbxassetid://1076137938'
  1115. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1116. mesh.Parent = bone
  1117. --
  1118. local bone = Instance.new("Part")
  1119. bone.Name = 'bone'
  1120. bone.CanCollide = false
  1121. bone.Anchored = false
  1122. bone.CFrame = obj.CFrame
  1123. bone.Size = obj.Size
  1124. bone.Massless = true
  1125. bone.Locked = true
  1126. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1127. if not exists then
  1128. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1129. end
  1130. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1131. game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1132. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1133. local weld = Instance.new("Weld")
  1134. weld.Part0 = bone
  1135. weld.Part1 = obj
  1136. weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
  1137. weld.Parent = bone
  1138. obj.Anchored = false
  1139. bone.Parent = script
  1140. local mesh = Instance.new("SpecialMesh")
  1141. mesh.MeshId = 'rbxassetid://1076136382'
  1142. mesh.TextureId = 'rbxassetid://1076137938'
  1143. mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1144. mesh.Parent = bone
  1145. end
  1146. end
  1147.  
  1148. function break_limb(obj,rig,targtorso,targhum,dir)
  1149. if not obj:FindFirstChild('Dismembered') and obj.Name ~= 'Torso' and obj.Name ~= 'HumanoidRootPart' and obj.Name ~= 'UpperTorso' and obj.Name ~= 'LowerTorso' then else return end
  1150. local confirm = Instance.new("ObjectValue")
  1151. confirm.Name = 'Dismembered'
  1152. confirm.Parent = obj
  1153. local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  1154. if bsc then
  1155. bsc:Destroy()
  1156. end
  1157. bleed2(obj,targhum,false,5,false)
  1158. add_blood(obj)
  1159. make_bone(obj,targtorso)
  1160. local kb = 70
  1161. local bv = Instance.new("BodyVelocity")
  1162. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1163. bv.Velocity = dir*kb+Vector3.new(0,kb,0)
  1164. bv.Parent = obj
  1165. game:GetService("Debris"):AddItem(bv,0.1)
  1166. if rig == Enum.HumanoidRigType.R6 then
  1167. local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  1168. if bsc then
  1169. bsc:Destroy()
  1170. end
  1171. for i,v in pairs(targtorso:GetChildren()) do
  1172. if v:IsA("Motor6D") then
  1173. if obj.Name == 'Head' and v.Name == 'Neck' then
  1174. v:Destroy()
  1175. elseif obj.Name == 'Left Arm' and v.Name == 'Left Shouldver' then
  1176. v:Destroy()
  1177. elseif obj.Name == 'Right Arm' and v.Name == 'Right Shoulder' then
  1178. v:Destroy()
  1179. elseif obj.Name == 'Left Leg' and v.Name == 'Left Hip' then
  1180. if obj.Parent:FindFirstChild("Right Leg") then
  1181. targhum.WalkSpeed = targhum.WalkSpeed/2
  1182. else
  1183. targhum.WalkSpeed = 0
  1184. end
  1185. v:Destroy()
  1186. elseif obj.Name == 'Right Leg' and v.Name == 'Right Hip' then
  1187. if obj.Parent:FindFirstChild("Left Leg") then
  1188. targhum.WalkSpeed = targhum.WalkSpeed/2
  1189. else
  1190. targhum.WalkSpeed = 0
  1191. end
  1192. v:Destroy()
  1193. end
  1194. end
  1195. end
  1196. elseif rig == Enum.HumanoidRigType.R15 then
  1197. for i,v in pairs(obj:GetChildren()) do
  1198. if v:IsA("Motor6D") then
  1199. if (obj.Name == 'LeftUpperLeg' and obj.Parent:FindFirstChild("RightUpperLeg")) or (obj.Name == 'RightUpperLeg' and obj.Parent:FindFirstChild("LeftUpperLeg")) then
  1200. targhum.WalkSpeed = targhum.WalkSpeed/2
  1201. elseif obj.Name == 'RightUpperLeg' or obj.Name == 'LeftUpperLeg' then
  1202. targhum.WalkSpeed = 0
  1203. end
  1204. v:Destroy()
  1205. end
  1206. end
  1207. end
  1208. local cb = Instance.new("Part")
  1209. cb.Name = 'limb'
  1210. cb.Transparency = 1
  1211. cb.CanCollide = true
  1212. cb.Anchored = false
  1213. cb.CFrame = obj.CFrame
  1214. cb.Size = obj.Size
  1215. cb.Massless = true
  1216. cb.Locked = true
  1217. local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1218. if not exists then
  1219. game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1220. end
  1221. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1222. game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  1223. game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1224. local weld = Instance.new("Weld")
  1225. weld.Part0 = cb
  1226. weld.Part1 = obj
  1227. weld.Parent = cb
  1228. obj.Massless = true
  1229. obj.Anchored = false
  1230. cb.Parent = script
  1231. end
  1232. function bleed2(frick,targhum,can_hurt,t,splat)
  1233. spawn(function()
  1234. if not frick:FindFirstChild("bleeding from kry's c4") then else return end
  1235. local tempbleedval = Instance.new("ObjectValue")
  1236. tempbleedval.Name = "bleeding from kry's c4"
  1237. tempbleedval.Parent = frick
  1238. local bleeding = true
  1239. local rig = targhum.RigType
  1240. local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
  1241. spawn(function()
  1242. wait(t)
  1243. bleeding = false
  1244. tempbleedval:Destroy()
  1245. end)
  1246. while bleeding and frick and frick.Parent do
  1247. if --[[(targhum and targhum.Parent and targhum.Health > 0) or]] (not frick or not frick.Parent or not targhum or not targhum.Parent) then
  1248. break
  1249. end
  1250. local max_limbs = 0
  1251. local current_limbs = 0
  1252. local gone_limbs = 0
  1253. local targchar = targhum.Parent
  1254. if rig == Enum.HumanoidRigType.R6 then
  1255. max_limbs = 5
  1256. elseif rig == Enum.HumanoidRigType.R15 then
  1257. max_limbs = 13
  1258. end
  1259. for i,v in pairs(targchar:GetChildren()) do
  1260. local found = false
  1261. for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
  1262. if found and not v:FindFirstChild("Dismembered") then
  1263. current_limbs = current_limbs + 1
  1264. end
  1265. end
  1266. gone_limbs = (max_limbs-current_limbs)
  1267. if targhum and can_hurt then
  1268. if gone_limbs >= 1 then
  1269. targhum:TakeDamage(0.5*gone_limbs)
  1270. else
  1271. targhum:TakeDamage(0.5)
  1272. end
  1273. end
  1274. spawn(function()
  1275. local thing = Instance.new('Part')
  1276. thing.Parent = workspace
  1277. thing.Size = Vector3.new(0.1,0.1,0.1)
  1278. thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
  1279. if splat then
  1280. thing.Transparency = 0
  1281. elseif not splat then
  1282. thing.Transparency = 1
  1283. end
  1284. thing.Color = Color3.fromRGB(75, 0, 0)
  1285. thing.Material = Enum.Material.Glass
  1286. thing.Name = "blood_drop"
  1287. thing.CanCollide =false
  1288. thing:BreakJoints()
  1289. local mesh = Instance.new('SpecialMesh')
  1290. mesh.MeshType = Enum.MeshType.Sphere
  1291. mesh.Parent = thing
  1292. --game:GetService("Debris"):AddItem(thing,5)
  1293. local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
  1294. att1.Parent = thing
  1295. att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
  1296. att2.Parent = thing
  1297. att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
  1298. if splat then
  1299. local trail_drop = Instance.new("Trail")
  1300. trail_drop.Parent = thing
  1301. trail_drop.Attachment0 = att1
  1302. trail_drop.Attachment1 = att2
  1303. trail_drop.Color = ColorSequence.new(Color3.new(0.294118, 0, 0),Color3.new(0.294118, 0, 0))
  1304. trail_drop.FaceCamera = true
  1305. trail_drop.LightInfluence = 1
  1306. trail_drop.Transparency = NumberSequence.new(0.1,1)
  1307. trail_drop.Lifetime = 1
  1308. trail_drop.MinLength = 0
  1309. end
  1310. local rawrxd = Instance.new('BodyForce')
  1311. rawrxd.Parent = thing
  1312. if splat then
  1313. rawrxd.Force = frick.CFrame.upVector+Vector3.new(math.random(-5, 5)/10,3,math.random(-5, 5)/10)
  1314. elseif not splat then
  1315. rawrxd.Force = frick.CFrame.upVector*(math.random()*2)+Vector3.new(math.random(-5, 5)/10,1.5,0)
  1316. end
  1317. game:GetService("Debris"):AddItem(rawrxd,0.01)
  1318. thing.Touched:connect(function(tou)
  1319. if tou and tou.Parent and not tou:IsDescendantOf(targchar) and not tou.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent:IsA("Accessory") and tou.Name ~= 'Handle' and tou.Parent.Name ~= 'Handle' and not tou.Parent:IsA("Tool") and not string.match(tou.Name:lower(),'blood_drop') and not string.match(tou.Name:lower(),'bullet') and not string.match(tou.Name:lower(),'bone') and not string.match(tou.Name:lower(),'gun mag') and not string.match(tou.Name:lower(),'limb') then
  1320. local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
  1321. local Point1 = pos-Vector3.new(0.01,0.01,0.01)
  1322. local Point2 = pos+Vector3.new(0.01,0.01,0.01)
  1323. local Region = Region3.new(Point1,Point2)
  1324. for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  1325. if Part.Name == "blood" then
  1326. tou = Part
  1327. end
  1328. end
  1329. thing:Destroy()
  1330. if tou.Name == "blood" then
  1331. local reee = tou.CFrame
  1332. if tou.Transparency > -0.2 then
  1333. tou.Transparency = tou.Transparency - 0.1
  1334. end
  1335. if tou.Size.X < 5 then
  1336. tou.Size = tou.Size+Vector3.new(0.4,0,0.4)
  1337. tou.CFrame = reee
  1338. elseif tou.Size.X < 7.5 then
  1339. tou.Size = tou.Size+Vector3.new(0.3,0,0.3)
  1340. tou.CFrame = reee
  1341. elseif tou.Size.X < 10 then
  1342. tou.Size = tou.Size+Vector3.new(0.2,0,0.2)
  1343. tou.CFrame = reee
  1344. end
  1345. elseif tou.CanCollide == true then
  1346. local bloodlol = Instance.new('Part')
  1347. if gone_limbs >= 1 then
  1348. bloodlol.Size = Vector3.new(1*gone_limbs,0.2,1*gone_limbs)
  1349. else
  1350. bloodlol.Size = Vector3.new(1,0.2,1)
  1351. end
  1352. bloodlol.Name = "blood"
  1353. bloodlol.Anchored = true
  1354. bloodlol.CanCollide = false
  1355. bloodlol.Material = Enum.Material.Glass
  1356. bloodlol.Color = Color3.fromRGB(75, 0, 0)
  1357. local mesh = Instance.new('SpecialMesh')
  1358. mesh.MeshType = Enum.MeshType.Sphere
  1359. mesh.Parent = bloodlol
  1360. bloodlol.Parent = workspace
  1361. bloodlol.CFrame = CFrame.new(pos)
  1362. while bloodlol and bloodlol.Parent ~= nil do
  1363. if bloodlol.Transparency < 1 then
  1364. bloodlol.Transparency = bloodlol.Transparency + 0.05
  1365. else
  1366. bloodlol:Destroy()
  1367. end
  1368. wait(0.1)
  1369. end
  1370. end
  1371. end
  1372. end)
  1373. end)
  1374. wait(0.1)
  1375. end
  1376. tempbleedval:Destroy()
  1377. end)
  1378. end
  1379. function gore_explode(obj,dir)
  1380. local targchar,targhead,targtorso,targhum,killval
  1381. pcall(function()
  1382. targchar = obj.Parent
  1383. end)
  1384. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1385. if v and v.Character and obj:IsDescendantOf(v.Character) then
  1386. targchar = v.Character
  1387. end
  1388. end
  1389. pcall(function()
  1390. targhead = targchar:FindFirstChild("Head")
  1391. end)
  1392. pcall(function()
  1393. targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  1394. end)
  1395. pcall(function()
  1396. targhum = targchar:FindFirstChildOfClass("Humanoid")
  1397. end)
  1398. pcall(function()
  1399. killval = targhum:FindFirstChild("killer")
  1400. end)
  1401. if targchar and targhead and targtorso and targhum and not killval then
  1402. targhum:TakeDamage(1/0)
  1403. break_limb(targhead,targhum.RigType,targtorso,targhum,dir)
  1404. if 0 > targhum.Health then
  1405. local bleeding = Instance.new("Sound")
  1406. bleeding.SoundId = 'rbxassetid://360007673'
  1407. bleeding.Volume = 0.5
  1408. bleeding.Parent = obj
  1409. bleeding:Play()
  1410. local fakechar,faketorso
  1411. local tempkillval = Instance.new("ObjectValue",targhum)
  1412. tempkillval.Name = "killer"
  1413. tempkillval.Value = plr
  1414. local kb = 75
  1415. local bv = Instance.new("BodyVelocity")
  1416. bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1417. bv.Velocity = dir*kb+Vector3.new(0,kb,0)
  1418. bv.Parent = targtorso
  1419. game:GetService("Debris"):AddItem(bv,0.1)
  1420. pcall(function()
  1421. local tempkillval = Instance.new("ObjectValue")
  1422. tempkillval.Name = 'killer'
  1423. tempkillval.Value = nil -- plr
  1424. tempkillval.Parent = hum
  1425. local ragval = Instance.new("ObjectValue")
  1426. ragval.Name = 'Ragdolled'
  1427. ragval.Parent = hum
  1428. hum.AutoRotate = false
  1429. hum.PlatformStand = true
  1430. Ragdoll(targchar,true,false,true)
  1431. end)
  1432. bleed2(targtorso,targhum,true,5,true)
  1433. local decap_bleed = Instance.new("Sound")
  1434. decap_bleed.SoundId = 'rbxassetid://244502094'
  1435. decap_bleed.Volume = 0.5
  1436. decap_bleed.Parent = targtorso
  1437. decap_bleed:Play()
  1438. local decap_head = Instance.new("Sound")
  1439. decap_head.SoundId = 'rbxassetid://1255040462' --222406108
  1440. decap_head.Volume = 1
  1441. decap_head.Parent = targtorso
  1442. decap_head:Play()
  1443. local att = Instance.new("Attachment")
  1444. att.Parent = targtorso
  1445. att.Position = Vector3.new(0,targtorso.Size.Y/2,0)
  1446. local blood_emitter = Instance.new("ParticleEmitter")
  1447. blood_emitter.Name = "Blood2"
  1448. blood_emitter.Parent = att
  1449. blood_emitter.Speed = NumberRange.new(5, 14)
  1450. blood_emitter.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
  1451. blood_emitter.LightEmission = 0.20000000298023
  1452. blood_emitter.LightInfluence = 1
  1453. blood_emitter.Texture = "http://www.roblox.com/asset/?id=134531274"
  1454. blood_emitter.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
  1455. blood_emitter.ZOffset = 0
  1456. blood_emitter.Size = NumberSequence.new(0.12499988079071,0)
  1457. blood_emitter.Acceleration = Vector3.new(0, -20, 0)
  1458. blood_emitter.Lifetime = NumberRange.new(0.5, 1.5)
  1459. blood_emitter.Rate = 100000
  1460. blood_emitter.SpreadAngle = Vector2.new(90, 90)
  1461. blood_emitter.VelocitySpread = 90
  1462. blood_emitter.Enabled = true
  1463. spawn(function()
  1464. wait(5)
  1465. blood_emitter.Enabled = false
  1466. game:GetService("Debris"):AddItem(blood_emitter,2)
  1467. end)
  1468. end
  1469. end
  1470. end
  1471.  
  1472. function explode(b)
  1473. local gores = {3739335007,3929462189,3737268126,3739335394,206082273,4953187368,4953187704} -- 3739364168
  1474. local exp = Instance.new("Part",script)
  1475. exp.Size = Vector3.new()
  1476. exp.Locked = true
  1477. exp.Anchored = true
  1478. exp.Transparency = 1
  1479. exp.Position = b.Position
  1480. b:Destroy()
  1481. local size = 125
  1482. local ex = Instance.new("Explosion",script)
  1483. ex.Visible = true
  1484. ex.Position = exp.Position
  1485. ex.BlastRadius = ((size/2)-1)
  1486. ex.BlastPressure = 1000000
  1487. ex.DestroyJointRadiusPercent = 1
  1488. ex.ExplosionType = Enum.ExplosionType.Craters
  1489. spawn(function()
  1490. ex_fx(ex,size)
  1491. end)
  1492. ex.Hit:connect(function(obj,dist)
  1493. if ((size/2)-1) >= dist and obj ~= exp then else return end
  1494. local targchar,targtorso,targhum
  1495. pcall(function()
  1496. targchar = obj.Parent
  1497. end)
  1498. pcall(function()
  1499. targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("LowerTorso") or targchar:FindFirstChild("HumanoidRootPart")
  1500. end)
  1501. pcall(function()
  1502. targhum = targchar:FindFirstChildOfClass("Humanoid")
  1503. end)
  1504. if targchar and targtorso and targhum then
  1505. local gore_s = Instance.new("Sound")
  1506. gore_s.SoundId = 'rbxassetid://' .. gores[math.random(1,#gores)]
  1507. gore_s.Volume = 0.1
  1508. gore_s.Parent = targtorso
  1509. gore_s:Play()
  1510. local dir = ((targtorso.Position-exp.Position)*Vector3.new(1,0,1)).Unit
  1511. gore_explode(obj,dir)
  1512. if math.random(1,5) == 1 then
  1513. break_limb(obj,targhum.RigType,targtorso,targhum,dir)
  1514. end
  1515. else
  1516. obj.Anchored = false
  1517. end
  1518. end)
  1519. debris:AddItem(ex,5)
  1520. local ex_s = Instance.new("Sound",exp)
  1521. ex_s.SoundId = "rbxassetid://2540028294"
  1522. ex_s.Volume = 10
  1523. ex_s:Play()
  1524. wait(0.5)
  1525. --[[
  1526. local twin = Instance.new("Sound",script)
  1527. twin.SoundId = "rbxassetid://180746497"
  1528. twin.Volume = 2
  1529. twin:Play()
  1530. ]]
  1531. end
  1532.  
  1533. function timer(bomb)
  1534. local BillboardGui0 = Instance.new("BillboardGui")
  1535. local TextButton1 = Instance.new("TextBox")
  1536. BillboardGui0.Parent = bomb
  1537. BillboardGui0.Size = UDim2.new(40, 40, 1, 1)
  1538. BillboardGui0.Active = true
  1539. BillboardGui0.StudsOffset = Vector3.new(0, 3, 0)
  1540. TextButton1.Parent = BillboardGui0
  1541. TextButton1.Size = UDim2.new(1, 0, 1, 0)
  1542. TextButton1.BackgroundColor = BrickColor.new("Institutional white")
  1543. TextButton1.BackgroundColor3 = Color3.new(1, 1, 1)
  1544. TextButton1.BackgroundTransparency = 1
  1545. TextButton1.Selectable = false
  1546. TextButton1.Font = Enum.Font.SourceSans
  1547. TextButton1.FontSize = Enum.FontSize.Size14
  1548. TextButton1.Text = ""
  1549. TextButton1.TextColor = BrickColor.new("Salmon")
  1550. TextButton1.TextColor3 = Color3.new(1, 0.509804, 0.639216)
  1551. TextButton1.TextScaled = true
  1552. TextButton1.TextSize = 14
  1553. TextButton1.TextStrokeTransparency = 0.5
  1554. TextButton1.TextWrap = true
  1555. TextButton1.TextWrapped = true
  1556. TextButton1.TextYAlignment = Enum.TextYAlignment.Top
  1557. local wt = 0.5
  1558. local att = Instance.new("Attachment")
  1559. att.Position = Vector3.new(-0.46, 0.15, 0.49)
  1560. att.Parent = bomb
  1561. local ParticleEmitter0 = Instance.new("ParticleEmitter")
  1562. ParticleEmitter0.Parent = att
  1563. ParticleEmitter0.Speed = NumberRange.new(0, 0)
  1564. ParticleEmitter0.Color = ColorSequence.new(Color3.new(1, 0, 0.0156863),Color3.new(1, 0, 0.0156863))
  1565. ParticleEmitter0.LightEmission = 1
  1566. ParticleEmitter0.LightInfluence = 1
  1567. ParticleEmitter0.ZOffset = 1
  1568. ParticleEmitter0.Size = NumberSequence.new(0.3,0.3)
  1569. ParticleEmitter0.Lifetime = NumberRange.new(0.1, 0.1)
  1570. ParticleEmitter0.Rate = 25
  1571. local s10_countdown
  1572. spawn(function()
  1573. repeat
  1574. local _wt = wt*(countdown/max_time)
  1575. ParticleEmitter0.Enabled = true
  1576. wait(_wt)
  1577. ParticleEmitter0.Enabled = false
  1578. local beep = Instance.new("Sound",bomb)
  1579. beep.SoundId = "rbxassetid://223016389"
  1580. beep.Volume = 0.6
  1581. --beep.PlaybackSpeed = 1+(0.3-(countdown/max_time)/3.3)
  1582. beep:Play()
  1583. wait(_wt)
  1584. until (0 >= countdown) or (completed_modules >= total_modules) or mistake
  1585. end)
  1586. repeat
  1587. countdown = countdown - 1
  1588. TextButton1.Text = "Time left: " .. countdown
  1589. if 10 >= countdown and not s10_countdown then
  1590. s10_countdown = Instance.new("Sound",bomb)
  1591. s10_countdown.SoundId = "rbxassetid://1476099718"
  1592. s10_countdown.Volume = 4
  1593. s10_countdown:Play()
  1594. end
  1595. wait(wt*2)
  1596. until (0 >= countdown) or (completed_modules >= total_modules) or mistake
  1597. if (completed_modules >= total_modules) then
  1598. --bomb:Destroy()
  1599. local bomb_defused = Instance.new("Sound",script)
  1600. bomb_defused.SoundId = "rbxassetid://3690455164"
  1601. bomb_defused.Volume = 2
  1602. bomb_defused:Play()
  1603. if s10_countdown then
  1604. s10_countdown:Destroy()
  1605. end
  1606. --[[
  1607. local ctwin = Instance.new("Sound",script)
  1608. ctwin.SoundId = "rbxassetid://180746506"
  1609. ctwin.Volume = 2
  1610. ctwin:Play()
  1611. ]]
  1612. TextButton1.Text = "Defused"
  1613. elseif mistake or (0 >= countdown) then
  1614. local de_s = Instance.new("Sound",bomb)
  1615. de_s.SoundId = "rbxassetid://4854660190"
  1616. de_s.Volume = 7
  1617. de_s:Play()
  1618. repeat wait() until not de_s.IsPlaying
  1619. explode(bomb)
  1620. end
  1621. end
  1622.  
  1623. local module_list = {
  1624. function(f)
  1625. if not f['clicker'] then
  1626. total_modules = total_modules + 1
  1627. table.insert(modules,#modules+1,{id = 'clicker',finished = false,clicks = 100})
  1628. else
  1629. create_module()
  1630. end
  1631. end;
  1632. function(f)
  1633. if not f['hold'] then
  1634. total_modules = total_modules + 1
  1635. table.insert(modules,#modules+1,{id = 'hold',finished = false,time = 10})
  1636. else
  1637. create_module()
  1638. end
  1639. end;
  1640. function(f)
  1641. if not f['square'] then
  1642. total_modules = total_modules + 1
  1643. local combination = {}
  1644. for i = 1,5 do
  1645. local mrd = math.random(1,4)
  1646. if mrd == 1 then
  1647. combination[i] = 'red'
  1648. elseif mrd == 2 then
  1649. combination[i] = 'blue'
  1650. elseif mrd == 3 then
  1651. combination[i] = 'green'
  1652. elseif mrd == 4 then
  1653. combination[i] = 'yellow'
  1654. end
  1655. end
  1656. table.insert(modules,#modules+1,{id = 'square',finished = false,combination = combination})
  1657. else
  1658. create_module()
  1659. end
  1660. end;
  1661. function(f)
  1662. if not f['dial'] then
  1663. total_modules = total_modules + 1
  1664. table.insert(modules,#modules+1,{id = 'dial',finished = false})
  1665. else
  1666. create_module()
  1667. end
  1668. end;
  1669. function(f)
  1670. if not f['wire'] then
  1671. total_modules = total_modules + 1
  1672. local color = ''
  1673. local text = ''
  1674. local mrd = math.random(1,3)
  1675. if mrd == 1 then
  1676. color = 'red'
  1677. if math.random(1,2) == 1 then
  1678. text = 'Cut the red color'
  1679. else
  1680. text = 'Cut blue'
  1681. end
  1682. elseif mrd == 2 then
  1683. color = 'blue'
  1684. if math.random(1,2) == 1 then
  1685. text = 'Cut the blue color'
  1686. else
  1687. text = 'Cut green'
  1688. end
  1689. elseif mrd == 3 then
  1690. color = 'green'
  1691. if math.random(1,2) == 1 then
  1692. text = 'Cut the green color'
  1693. else
  1694. text = 'Cut red'
  1695. end
  1696. end
  1697. table.insert(modules,#modules+1,{id = 'wire',finished = false,color = color,text = text,clicked = {}})
  1698. else
  1699. create_module()
  1700. end
  1701. end;
  1702. function(f)
  1703. if not f['panel'] then
  1704. total_modules = total_modules + 1
  1705. local ct = {}
  1706. for i = 1,8 do
  1707. local activated = 0
  1708. for i,v in pairs(ct) do
  1709. if v then
  1710. activated = activated + 1
  1711. end
  1712. end
  1713. if 7 > activated then
  1714. local bool = false
  1715. if math.random(1,2) == 1 then
  1716. bool = true
  1717. end
  1718. ct['d' .. i] = bool
  1719. else
  1720. break
  1721. end
  1722. end
  1723. table.insert(modules,#modules+1,{id = 'panel',finished = false,clicked = ct})
  1724. else
  1725. create_module()
  1726. end
  1727. end;
  1728. }
  1729.  
  1730. function create_module()
  1731. local f = {}
  1732. for i,v in pairs(modules) do
  1733. f[v.id] = true
  1734. end
  1735. module_list[math.random(1,#module_list)](f)
  1736. end
  1737.  
  1738. function get_time()
  1739. local n = countdown
  1740. local mins = 0
  1741. local t = ''
  1742. if n >= mins then
  1743. mins = math.floor(n/60)
  1744. n = n-mins*60;
  1745. end
  1746. if 0 >= mins then
  1747. t = '00:'
  1748. elseif 10 > mins then
  1749. t = '0' .. mins .. ':'
  1750. elseif mins >= 10 then
  1751. t = mins .. ':'
  1752. end
  1753. if 0 >= n then
  1754. t = t .. '00'
  1755. elseif 10 > n then
  1756. t = t .. '0' .. n
  1757. elseif n >= 10 then
  1758. t = t .. n
  1759. end
  1760. return t
  1761. end
  1762.  
  1763. function create_gui(p,t,bomb)
  1764. local pgui = p:FindFirstChildOfClass("PlayerGui")
  1765. local dgui = pgui:FindFirstChild("Defuse Gui")
  1766. local close = true
  1767. if pgui and t and bomb and not dgui then
  1768. local module_screen,time_t
  1769. local id = 1
  1770. local module = modules[id]
  1771. local lt = tick()
  1772. spawn(function()
  1773. while defuse_dist >= (bomb.Position-t.Position).Magnitude and (completed_modules < total_modules) and not mistake and bomb and countdown > 0 do
  1774. if module_screen then
  1775. if module.finished then
  1776. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  1777. end
  1778. if module.id == 'clicker' then
  1779. local b = module_screen:FindFirstChild("TextButton")
  1780. if b then
  1781. if not module.finished then
  1782. --b.Text = "CLICK (" .. module.clicks .. ")"
  1783. elseif module.finished and b.Text ~= 'DONE' then
  1784. b.Text = "DONE"
  1785. return
  1786. end
  1787. end
  1788. elseif module.id == 'hold' then
  1789. local b = module_screen:FindFirstChild("TextButton")
  1790. if b then
  1791. if module.finished and b.Text ~= 'DONE' then
  1792. b.Text = "DONE"
  1793. return
  1794. end
  1795. end
  1796. elseif module.id == 'panel' then
  1797. for _,button in pairs(module_screen:GetChildren()) do
  1798. if module.clicked[button.Name] then
  1799. button.BackgroundColor3 = Color3.new(0,1,0)
  1800. else
  1801. button.BackgroundColor3 = Color3.new(1,0,0)
  1802. end
  1803. end
  1804. elseif module.id == 'wire' then
  1805. for _,button in pairs(module_screen:GetChildren()) do
  1806. if module.clicked[button.Name] then
  1807. button:Destroy()
  1808. end
  1809. end
  1810. end
  1811. end
  1812. if time_t and tick()-lt >= 1 then
  1813. lt = tick()
  1814. time_t.Text = get_time()
  1815. end
  1816. wait(0.25)
  1817. end
  1818. close = false
  1819. if dgui then
  1820. dgui:Destroy()
  1821. end
  1822. end)
  1823. local ScreenGui0 = Instance.new("ScreenGui")
  1824. local Frame1 = Instance.new("Frame")
  1825. local TextButton2 = Instance.new("TextButton")
  1826. local TextButton3 = Instance.new("TextButton")
  1827. local Frame4 = Instance.new("Frame")
  1828. ScreenGui0.Name = 'Defuse Gui'
  1829. ScreenGui0.Parent = pgui
  1830. ScreenGui0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  1831. Frame1.Parent = ScreenGui0
  1832. Frame1.Position = UDim2.new(0.255, 0, 0.146, 0)
  1833. Frame1.Size = UDim2.new(0, 550, 0, 442)
  1834. Frame1.BackgroundColor = BrickColor.new("Dirt brown")
  1835. Frame1.BackgroundColor3 = Color3.new(0.223529, 0.223529, 0.223529)
  1836. TextButton2.Name = "before"
  1837. TextButton2.Parent = Frame1
  1838. TextButton2.Position = UDim2.new(0, 0, 0.929870009, 0)
  1839. TextButton2.Size = UDim2.new(0, 270, 0, 30)
  1840. TextButton2.BackgroundColor = BrickColor.new("Black")
  1841. TextButton2.BackgroundColor3 = Color3.new(0.211765, 0.211765, 0.211765)
  1842. TextButton2.Font = Enum.Font.SourceSans
  1843. TextButton2.FontSize = Enum.FontSize.Size14
  1844. TextButton2.Text = "<"
  1845. TextButton2.TextColor = BrickColor.new("Institutional white")
  1846. TextButton2.TextColor3 = Color3.new(1, 1, 1)
  1847. TextButton2.TextScaled = true
  1848. TextButton2.TextSize = 14
  1849. TextButton2.TextStrokeTransparency = 0
  1850. TextButton2.TextWrap = true
  1851. TextButton2.TextWrapped = true
  1852. TextButton3.Name = "next"
  1853. TextButton3.Parent = Frame1
  1854. TextButton3.Position = UDim2.new(0.507467151, 0, 0.929870009, 0)
  1855. TextButton3.Size = UDim2.new(0, 270, 0, 30)
  1856. TextButton3.BackgroundColor = BrickColor.new("Black")
  1857. TextButton3.BackgroundColor3 = Color3.new(0.211765, 0.211765, 0.211765)
  1858. TextButton3.Font = Enum.Font.SourceSans
  1859. TextButton3.FontSize = Enum.FontSize.Size14
  1860. TextButton3.Text = ">"
  1861. TextButton3.TextColor = BrickColor.new("Institutional white")
  1862. TextButton3.TextColor3 = Color3.new(1, 1, 1)
  1863. TextButton3.TextScaled = true
  1864. TextButton3.TextSize = 14
  1865. TextButton3.TextStrokeTransparency = 0
  1866. TextButton3.TextWrap = true
  1867. TextButton3.TextWrapped = true
  1868. Frame4.Name = "module_screen"
  1869. Frame4.Parent = Frame1
  1870. Frame4.Position = UDim2.new(0.0109090907, 0, 0.0135746608, 0)
  1871. Frame4.Size = UDim2.new(0, 537, 0, 398)
  1872. Frame4.BackgroundColor = BrickColor.new("Maroon")
  1873. Frame4.BackgroundColor3 = Color3.new(0.490196, 0, 0.00784314)
  1874.  
  1875. dgui = ScreenGui0
  1876.  
  1877. local main = dgui.Frame
  1878. module_screen = main.module_screen
  1879. local previous = main.before
  1880. local after = main.next
  1881.  
  1882. time_t = Instance.new("TextBox")
  1883. time_t.Name = "time"
  1884. time_t.Parent = main
  1885. time_t.Position = UDim2.new(0, 0, -0.113122173, 0)
  1886. time_t.Size = UDim2.new(0, 550, 0, 50)
  1887. time_t.BackgroundColor = BrickColor.new("Black metallic")
  1888. time_t.BackgroundColor3 = Color3.new(0.133333, 0.133333, 0.133333)
  1889. time_t.Font = Enum.Font.SourceSans
  1890. time_t.FontSize = Enum.FontSize.Size14
  1891. time_t.TextColor = BrickColor.new("Institutional white")
  1892. time_t.TextColor3 = Color3.new(1, 1, 1)
  1893. time_t.TextScaled = true
  1894. time_t.TextSize = 14
  1895. time_t.TextStrokeTransparency = 0
  1896. time_t.TextWrap = true
  1897. time_t.TextWrapped = true
  1898.  
  1899. local function load_module()
  1900. if close or mistake then else dgui:Destroy(); return; end;
  1901. module_screen:ClearAllChildren()
  1902. if module.finished then
  1903. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  1904. else
  1905. module_screen.BackgroundColor3 = Color3.fromRGB(47,47,47)
  1906. end
  1907. if module.id == 'clicker' then
  1908. local TextButton0 = Instance.new("TextButton")
  1909. TextButton0.Parent = module_screen
  1910. TextButton0.Position = UDim2.new(0.314711362, 0, 0.527638197, 0)
  1911. TextButton0.Size = UDim2.new(0, 200, 0, 114)
  1912. TextButton0.BackgroundColor = BrickColor.new("Silver flip/flop")
  1913. TextButton0.BackgroundColor3 = Color3.new(0.541176, 0.541176, 0.541176)
  1914. TextButton0.Font = Enum.Font.SourceSans
  1915. TextButton0.FontSize = Enum.FontSize.Size14
  1916. TextButton0.TextColor = BrickColor.new("Really black")
  1917. TextButton0.TextColor3 = Color3.new(0, 0, 0)
  1918. TextButton0.TextScaled = true
  1919. TextButton0.TextSize = 14
  1920. TextButton0.TextWrap = true
  1921. TextButton0.TextWrapped = true
  1922. if not module.finished then
  1923. TextButton0.Text = "CLICK ALOT"
  1924. else
  1925. TextButton0.Text = "DONE"
  1926. return
  1927. end
  1928. TextButton0.MouseButton1Click:Connect(function()
  1929. if module.finished then
  1930. TextButton0.Text = "DONE"
  1931. return
  1932. end
  1933. module.clicks = module.clicks - 1
  1934. if 0 >= module.clicks and not module.finished then
  1935. module.finished = true
  1936. local click_s = Instance.new("Sound")
  1937. click_s.SoundId = 'rbxassetid://317553816'
  1938. click_s.Volume = 1
  1939. click_s.Parent = dgui
  1940. click_s:Play()
  1941. local cm = 0
  1942. for i,v in pairs(modules) do
  1943. if v.finished then
  1944. cm = cm + 1
  1945. end
  1946. end
  1947. completed_modules = cm
  1948. end
  1949. if module.finished then
  1950. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  1951. TextButton0.Text = "DONE"
  1952. end
  1953. end)
  1954. elseif module.id == 'panel' then
  1955. local TextButton0 = Instance.new("TextButton")
  1956. local TextButton1 = Instance.new("TextButton")
  1957. local TextButton2 = Instance.new("TextButton")
  1958. local TextButton3 = Instance.new("TextButton")
  1959. local TextButton4 = Instance.new("TextButton")
  1960. local TextButton5 = Instance.new("TextButton")
  1961. local TextButton6 = Instance.new("TextButton")
  1962. local TextButton7 = Instance.new("TextButton")
  1963. local TextButton8 = Instance.new("TextButton")
  1964. TextButton0.Name = "d1"
  1965. TextButton0.Parent = module_screen
  1966. TextButton0.Position = UDim2.new(0.132216007, 0, 0.113065332, 0)
  1967. TextButton0.Size = UDim2.new(0, 80, 0, 80)
  1968. TextButton0.BackgroundColor = BrickColor.new("Institutional white")
  1969. TextButton0.BackgroundColor3 = Color3.new(1, 1, 1)
  1970. TextButton0.BackgroundTransparency = 0.20000000298023
  1971. TextButton0.Font = Enum.Font.SourceSans
  1972. TextButton0.FontSize = Enum.FontSize.Size14
  1973. TextButton0.Text = ""
  1974. TextButton0.TextColor = BrickColor.new("Really black")
  1975. TextButton0.TextColor3 = Color3.new(0, 0, 0)
  1976. TextButton0.TextSize = 14
  1977. TextButton1.Name = "d2"
  1978. TextButton1.Parent = module_screen
  1979. TextButton1.Position = UDim2.new(0.422718793, 0, 0.394472361, 0)
  1980. TextButton1.Size = UDim2.new(0, 80, 0, 80)
  1981. TextButton1.BackgroundColor = BrickColor.new("Institutional white")
  1982. TextButton1.BackgroundColor3 = Color3.new(1, 1, 1)
  1983. TextButton1.BackgroundTransparency = 0.20000000298023
  1984. TextButton1.Font = Enum.Font.SourceSans
  1985. TextButton1.FontSize = Enum.FontSize.Size14
  1986. TextButton1.Text = ""
  1987. TextButton1.TextColor = BrickColor.new("Really black")
  1988. TextButton1.TextColor3 = Color3.new(0, 0, 0)
  1989. TextButton1.TextSize = 14
  1990. TextButton2.Name = "d3"
  1991. TextButton2.Parent = module_screen
  1992. TextButton2.Position = UDim2.new(0.71322155, 0, 0.115577862, 0)
  1993. TextButton2.Size = UDim2.new(0, 80, 0, 80)
  1994. TextButton2.BackgroundColor = BrickColor.new("Institutional white")
  1995. TextButton2.BackgroundColor3 = Color3.new(1, 1, 1)
  1996. TextButton2.BackgroundTransparency = 0.20000000298023
  1997. TextButton2.Font = Enum.Font.SourceSans
  1998. TextButton2.FontSize = Enum.FontSize.Size14
  1999. TextButton2.Text = ""
  2000. TextButton2.TextColor = BrickColor.new("Really black")
  2001. TextButton2.TextColor3 = Color3.new(0, 0, 0)
  2002. TextButton2.TextSize = 14
  2003. TextButton3.Name = "d4"
  2004. TextButton3.Parent = module_screen
  2005. TextButton3.Position = UDim2.new(0.71322155, 0, 0.678391933, 0)
  2006. TextButton3.Size = UDim2.new(0, 80, 0, 80)
  2007. TextButton3.BackgroundColor = BrickColor.new("Institutional white")
  2008. TextButton3.BackgroundColor3 = Color3.new(1, 1, 1)
  2009. TextButton3.BackgroundTransparency = 0.20000000298023
  2010. TextButton3.Font = Enum.Font.SourceSans
  2011. TextButton3.FontSize = Enum.FontSize.Size14
  2012. TextButton3.Text = ""
  2013. TextButton3.TextColor = BrickColor.new("Really black")
  2014. TextButton3.TextColor3 = Color3.new(0, 0, 0)
  2015. TextButton3.TextSize = 14
  2016. TextButton4.Name = "d5"
  2017. TextButton4.Parent = module_screen
  2018. TextButton4.Position = UDim2.new(0.132215962, 0, 0.678391933, 0)
  2019. TextButton4.Size = UDim2.new(0, 80, 0, 80)
  2020. TextButton4.BackgroundColor = BrickColor.new("Institutional white")
  2021. TextButton4.BackgroundColor3 = Color3.new(1, 1, 1)
  2022. TextButton4.BackgroundTransparency = 0.20000000298023
  2023. TextButton4.Font = Enum.Font.SourceSans
  2024. TextButton4.FontSize = Enum.FontSize.Size14
  2025. TextButton4.Text = ""
  2026. TextButton4.TextColor = BrickColor.new("Really black")
  2027. TextButton4.TextColor3 = Color3.new(0, 0, 0)
  2028. TextButton4.TextSize = 14
  2029. TextButton5.Name = "d6"
  2030. TextButton5.Parent = module_screen
  2031. TextButton5.Position = UDim2.new(0.422718793, 0, 0.77638191, 0)
  2032. TextButton5.Size = UDim2.new(0, 80, 0, 80)
  2033. TextButton5.BackgroundColor = BrickColor.new("Institutional white")
  2034. TextButton5.BackgroundColor3 = Color3.new(1, 1, 1)
  2035. TextButton5.BackgroundTransparency = 0.20000000298023
  2036. TextButton5.Font = Enum.Font.SourceSans
  2037. TextButton5.FontSize = Enum.FontSize.Size14
  2038. TextButton5.Text = ""
  2039. TextButton5.TextColor = BrickColor.new("Really black")
  2040. TextButton5.TextColor3 = Color3.new(0, 0, 0)
  2041. TextButton5.TextSize = 14
  2042. TextButton6.Name = "d7"
  2043. TextButton6.Parent = module_screen
  2044. TextButton6.Position = UDim2.new(0.422718793, 0, 0.0226130337, 0)
  2045. TextButton6.Size = UDim2.new(0, 80, 0, 80)
  2046. TextButton6.BackgroundColor = BrickColor.new("Institutional white")
  2047. TextButton6.BackgroundColor3 = Color3.new(1, 1, 1)
  2048. TextButton6.BackgroundTransparency = 0.20000000298023
  2049. TextButton6.Font = Enum.Font.SourceSans
  2050. TextButton6.FontSize = Enum.FontSize.Size14
  2051. TextButton6.Text = ""
  2052. TextButton6.TextColor = BrickColor.new("Really black")
  2053. TextButton6.TextColor3 = Color3.new(0, 0, 0)
  2054. TextButton6.TextSize = 14
  2055. TextButton7.Name = "d8"
  2056. TextButton7.Parent = module_screen
  2057. TextButton7.Position = UDim2.new(0.789571643, 0, 0.394472331, 0)
  2058. TextButton7.Size = UDim2.new(0, 80, 0, 80)
  2059. TextButton7.BackgroundColor = BrickColor.new("Institutional white")
  2060. TextButton7.BackgroundColor3 = Color3.new(1, 1, 1)
  2061. TextButton7.BackgroundTransparency = 0.20000000298023
  2062. TextButton7.Font = Enum.Font.SourceSans
  2063. TextButton7.FontSize = Enum.FontSize.Size14
  2064. TextButton7.Text = ""
  2065. TextButton7.TextColor = BrickColor.new("Really black")
  2066. TextButton7.TextColor3 = Color3.new(0, 0, 0)
  2067. TextButton7.TextSize = 14
  2068. TextButton8.Name = "d9"
  2069. TextButton8.Parent = module_screen
  2070. TextButton8.Position = UDim2.new(0.0651768446, 0, 0.394472331, 0)
  2071. TextButton8.Size = UDim2.new(0, 80, 0, 80)
  2072. TextButton8.BackgroundColor = BrickColor.new("Institutional white")
  2073. TextButton8.BackgroundColor3 = Color3.new(1, 1, 1)
  2074. TextButton8.BackgroundTransparency = 0.20000000298023
  2075. TextButton8.Font = Enum.Font.SourceSans
  2076. TextButton8.FontSize = Enum.FontSize.Size14
  2077. TextButton8.Text = ""
  2078. TextButton8.TextColor = BrickColor.new("Really black")
  2079. TextButton8.TextColor3 = Color3.new(0, 0, 0)
  2080. TextButton8.TextSize = 14
  2081. for _,button in pairs(module_screen:GetChildren()) do
  2082. if module.clicked[button.Name] then
  2083. button.BackgroundColor3 = Color3.new(0,1,0)
  2084. else
  2085. button.BackgroundColor3 = Color3.new(1,0,0)
  2086. end
  2087. button.MouseButton1Click:Connect(function()
  2088. if module.finished then
  2089. return
  2090. end
  2091. if module.clicked[button.Name] then
  2092. module.clicked[button.Name] = false
  2093. button.BackgroundColor3 = Color3.new(1,0,0)
  2094. else
  2095. module.clicked[button.Name] = true
  2096. button.BackgroundColor3 = Color3.new(0,1,0)
  2097. end
  2098. local click_s = Instance.new("Sound")
  2099. click_s.SoundId = 'rbxassetid://5289642056'
  2100. click_s.PlaybackSpeed = math.random(100,110)/100
  2101. click_s.Volume = 1
  2102. click_s.Parent = dgui
  2103. click_s:Play()
  2104. local clicked = 0
  2105. for i,v in pairs(module.clicked) do
  2106. if i and v then
  2107. clicked = clicked + 1
  2108. end
  2109. end
  2110. if clicked >= #module_screen:GetChildren() and not module.finished then
  2111. module.finished = true
  2112. local click_s = Instance.new("Sound")
  2113. click_s.SoundId = 'rbxassetid://317553816'
  2114. click_s.Volume = 1
  2115. click_s.Parent = dgui
  2116. click_s:Play()
  2117. local cm = 0
  2118. for i,v in pairs(modules) do
  2119. if v.finished then
  2120. cm = cm + 1
  2121. end
  2122. end
  2123. completed_modules = cm
  2124. end
  2125. if module.finished then
  2126. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  2127. end
  2128. end)
  2129. end
  2130. elseif module.id == 'square' then
  2131. local TextButton0 = Instance.new("TextButton")
  2132. local TextButton1 = Instance.new("TextButton")
  2133. local TextButton2 = Instance.new("TextButton")
  2134. local TextLabel3 = Instance.new("TextBox")
  2135. local TextButton4 = Instance.new("TextButton")
  2136. TextButton0.Name = "green"
  2137. TextButton0.Parent = module_screen
  2138. TextButton0.Position = UDim2.new(0.305400372, 0, 0.55276376, 0)
  2139. TextButton0.Size = UDim2.new(0, 100, 0, 100)
  2140. TextButton0.BackgroundColor = BrickColor.new("Lime green")
  2141. TextButton0.BackgroundColor3 = Color3.new(0, 1, 0)
  2142. TextButton0.BackgroundTransparency = 0.7
  2143. TextButton0.Font = Enum.Font.SourceSans
  2144. TextButton0.FontSize = Enum.FontSize.Size14
  2145. TextButton0.Text = ""
  2146. TextButton0.TextColor = BrickColor.new("Really black")
  2147. TextButton0.TextColor3 = Color3.new(0, 0, 0)
  2148. TextButton0.TextSize = 14
  2149. TextButton1.Name = "red"
  2150. TextButton1.Parent = module_screen
  2151. TextButton1.Position = UDim2.new(0.305400372, 0, 0.27638185, 0)
  2152. TextButton1.Size = UDim2.new(0, 100, 0, 100)
  2153. TextButton1.BackgroundColor = BrickColor.new("Really red")
  2154. TextButton1.BackgroundColor3 = Color3.new(1, 0, 0)
  2155. TextButton1.BackgroundTransparency = 0.7
  2156. TextButton1.Font = Enum.Font.SourceSans
  2157. TextButton1.FontSize = Enum.FontSize.Size14
  2158. TextButton1.Text = ""
  2159. TextButton1.TextColor = BrickColor.new("Really black")
  2160. TextButton1.TextColor3 = Color3.new(0, 0, 0)
  2161. TextButton1.TextSize = 14
  2162. TextButton2.Name = "yellow"
  2163. TextButton2.Parent = module_screen
  2164. TextButton2.Position = UDim2.new(0.508379877, 0, 0.55276376, 0)
  2165. TextButton2.Size = UDim2.new(0, 100, 0, 100)
  2166. TextButton2.BackgroundColor = BrickColor.new("New Yeller")
  2167. TextButton2.BackgroundColor3 = Color3.new(1, 1, 0)
  2168. TextButton2.BackgroundTransparency = 0.7
  2169. TextButton2.Font = Enum.Font.SourceSans
  2170. TextButton2.FontSize = Enum.FontSize.Size14
  2171. TextButton2.Text = ""
  2172. TextButton2.TextColor = BrickColor.new("Really black")
  2173. TextButton2.TextColor3 = Color3.new(0, 0, 0)
  2174. TextButton2.TextSize = 14
  2175. TextLabel3.Name = "title"
  2176. TextLabel3.Parent = module_screen
  2177. TextLabel3.Size = UDim2.new(0, 537, 0, 100)
  2178. TextLabel3.BackgroundColor = BrickColor.new("Institutional white")
  2179. TextLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
  2180. TextLabel3.BackgroundTransparency = 1
  2181. TextLabel3.Font = Enum.Font.SourceSans
  2182. TextLabel3.FontSize = Enum.FontSize.Size14
  2183. wait()
  2184. TextLabel3.Text = "Hit the colors in the right order"
  2185. TextLabel3.TextColor = BrickColor.new("Institutional white")
  2186. TextLabel3.TextColor3 = Color3.new(1, 1, 1)
  2187. TextLabel3.TextScaled = true
  2188. TextLabel3.TextSize = 14
  2189. TextLabel3.TextStrokeTransparency = 0
  2190. TextLabel3.TextWrap = true
  2191. TextLabel3.TextWrapped = true
  2192. TextButton4.Name = "blue"
  2193. TextButton4.Parent = module_screen
  2194. TextButton4.Position = UDim2.new(0.508379877, 0, 0.27638185, 0)
  2195. TextButton4.Size = UDim2.new(0, 100, 0, 100)
  2196. TextButton4.BackgroundColor = BrickColor.new("Really blue")
  2197. TextButton4.BackgroundColor3 = Color3.new(0, 0, 1)
  2198. TextButton4.BackgroundTransparency = 0.7
  2199. TextButton4.Font = Enum.Font.SourceSans
  2200. TextButton4.FontSize = Enum.FontSize.Size14
  2201. TextButton4.Text = ""
  2202. TextButton4.TextColor = BrickColor.new("Really black")
  2203. TextButton4.TextColor3 = Color3.new(0, 0, 0)
  2204. TextButton4.TextSize = 14
  2205. local order = {}
  2206. local pressed = 0
  2207. local can_press = false
  2208. if module.finished then
  2209. return
  2210. end
  2211. for _,button in pairs(module_screen:GetChildren()) do
  2212. if button:IsA("TextButton") then
  2213. button.MouseButton1Click:Connect(function()
  2214. local click_s = Instance.new("Sound")
  2215. click_s.SoundId = 'rbxassetid://1283290053'
  2216. click_s.PlaybackSpeed = math.random(100,110)/100
  2217. click_s.Volume = 1
  2218. click_s.Parent = dgui
  2219. click_s:Play()
  2220. if module.finished or not can_press then
  2221. return
  2222. end
  2223. if order[pressed+1] == button.Name then
  2224. pressed = pressed + 1
  2225. else
  2226. mistake = true
  2227. local mistake_s = Instance.new("Sound")
  2228. mistake_s.SoundId = 'rbxassetid://1000294392'
  2229. mistake_s.Volume = 1
  2230. mistake_s.Parent = dgui
  2231. mistake_s:Play()
  2232. end
  2233. button.BackgroundTransparency = 0
  2234. wait(0.5)
  2235. button.BackgroundTransparency = 0.7
  2236. end)
  2237. end
  2238. end
  2239. for i = 1,5 do
  2240. can_press = true
  2241. wait(1)
  2242. pressed = 0
  2243. if dgui and module.id == 'square' then else return end
  2244. table.insert(order,#order+1,module.combination[i])
  2245. for i2 = 1,i do
  2246. if dgui and module.id == 'square' then else return end
  2247. module_screen[module.combination[i2]].BackgroundTransparency = 0
  2248. local click_s = Instance.new("Sound")
  2249. click_s.SoundId = 'rbxassetid://300473653'
  2250. click_s.PlaybackSpeed = math.random(100,110)/100
  2251. click_s.Volume = 1
  2252. click_s.Parent = dgui
  2253. click_s:Play()
  2254. wait(0.5)
  2255. if dgui and module.id == 'square' then else return end
  2256. module_screen[module.combination[i2]].BackgroundTransparency = 0.7
  2257. wait(0.1)
  2258. end
  2259. can_press = true
  2260. repeat wait(0.1) until pressed >= i or module.id ~= 'square'
  2261. if dgui and module.id == 'square' then else return end
  2262. end
  2263. if not module.finished and not mistake and dgui and module.id == 'square' then
  2264. module.finished = true
  2265. local click_s = Instance.new("Sound")
  2266. click_s.SoundId = 'rbxassetid://317553816'
  2267. click_s.Volume = 1
  2268. click_s.Parent = dgui
  2269. click_s:Play()
  2270. local cm = 0
  2271. for i,v in pairs(modules) do
  2272. if v.finished then
  2273. cm = cm + 1
  2274. end
  2275. end
  2276. completed_modules = cm
  2277. end
  2278. if module.finished then
  2279. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  2280. end
  2281. elseif module.id == 'dial' then
  2282. local Frame0 = Instance.new("Frame")
  2283. local Frame1 = Instance.new("Frame")
  2284. local Frame2 = Instance.new("Frame")
  2285. local Frame3 = Instance.new("Frame")
  2286. local Frame4 = Instance.new("Frame")
  2287. local Frame5 = Instance.new("Frame")
  2288. local Frame6 = Instance.new("Frame")
  2289. local TextButton7 = Instance.new("TextButton")
  2290. local TextButton8 = Instance.new("TextButton")
  2291. local TextButton9 = Instance.new("TextButton")
  2292. local TextButton10 = Instance.new("TextButton")
  2293. local TextLabel11 = Instance.new("TextBox")
  2294. Frame0.Name = "1"
  2295. Frame0.Parent = module_screen
  2296. Frame0.Position = UDim2.new(0.890799582, 0, 0.884346724, 0)
  2297. Frame0.Size = UDim2.new(0, 37, 0, 16)
  2298. Frame0.BackgroundColor = BrickColor.new("Black")
  2299. Frame0.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  2300. Frame0.ZIndex = 2
  2301. Frame1.Name = "2"
  2302. Frame1.Parent = module_screen
  2303. Frame1.Position = UDim2.new(0.890799582, 0, 0.818944752, 0)
  2304. Frame1.Size = UDim2.new(0, 37, 0, 16)
  2305. Frame1.BackgroundColor = BrickColor.new("Black")
  2306. Frame1.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  2307. Frame1.ZIndex = 2
  2308. Frame2.Name = "3"
  2309. Frame2.Parent = module_screen
  2310. Frame2.Position = UDim2.new(0.890799582, 0, 0.756984949, 0)
  2311. Frame2.Size = UDim2.new(0, 37, 0, 16)
  2312. Frame2.BackgroundColor = BrickColor.new("Black")
  2313. Frame2.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  2314. Frame2.ZIndex = 2
  2315. Frame3.Name = "4"
  2316. Frame3.Parent = module_screen
  2317. Frame3.Position = UDim2.new(0.890799582, 0, 0.691582918, 0)
  2318. Frame3.Size = UDim2.new(0, 37, 0, 16)
  2319. Frame3.BackgroundColor = BrickColor.new("Black")
  2320. Frame3.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  2321. Frame3.ZIndex = 2
  2322. Frame4.Name = "5"
  2323. Frame4.Parent = module_screen
  2324. Frame4.Position = UDim2.new(0.890799582, 0, 0.622738719, 0)
  2325. Frame4.Size = UDim2.new(0, 37, 0, 16)
  2326. Frame4.BackgroundColor = BrickColor.new("Black")
  2327. Frame4.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
  2328. Frame4.ZIndex = 2
  2329. Frame5.Parent = module_screen
  2330. Frame5.Position = UDim2.new(0.88081938, 0, 0.605527639, 0)
  2331. Frame5.Size = UDim2.new(0, 49, 0, 137)
  2332. Frame5.BackgroundColor = BrickColor.new("Really black")
  2333. Frame5.BackgroundColor3 = Color3.new(0, 0, 0)
  2334. Frame6.Parent = module_screen
  2335. Frame6.Position = UDim2.new(0.126629427, 0, 0.0603015088, 0)
  2336. Frame6.Size = UDim2.new(0, 387, 0, 217)
  2337. Frame6.BackgroundColor = BrickColor.new("Really black")
  2338. Frame6.BackgroundColor3 = Color3.new(0, 0, 0)
  2339. TextButton7.Name = "n1"
  2340. TextButton7.Parent = module_screen
  2341. TextButton7.Position = UDim2.new(0.0465549342, 0, 0.660804033, 0)
  2342. TextButton7.Size = UDim2.new(0, 100, 0, 100)
  2343. TextButton7.BackgroundColor = BrickColor.new("Earth green")
  2344. TextButton7.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
  2345. TextButton7.Font = Enum.Font.Merriweather
  2346. TextButton7.FontSize = Enum.FontSize.Size14
  2347. TextButton7.Text = "I"
  2348. TextButton7.TextColor = BrickColor.new("Institutional white")
  2349. TextButton7.TextColor3 = Color3.new(1, 1, 1)
  2350. TextButton7.TextScaled = true
  2351. TextButton7.TextSize = 14
  2352. TextButton7.TextStrokeTransparency = 0
  2353. TextButton7.TextWrap = true
  2354. TextButton7.TextWrapped = true
  2355. TextButton8.Name = "n2"
  2356. TextButton8.Parent = module_screen
  2357. TextButton8.Position = UDim2.new(0.249534458, 0, 0.660804033, 0)
  2358. TextButton8.Size = UDim2.new(0, 100, 0, 100)
  2359. TextButton8.BackgroundColor = BrickColor.new("Earth green")
  2360. TextButton8.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
  2361. TextButton8.Font = Enum.Font.Merriweather
  2362. TextButton8.FontSize = Enum.FontSize.Size14
  2363. TextButton8.Text = "II"
  2364. TextButton8.TextColor = BrickColor.new("Institutional white")
  2365. TextButton8.TextColor3 = Color3.new(1, 1, 1)
  2366. TextButton8.TextScaled = true
  2367. TextButton8.TextSize = 14
  2368. TextButton8.TextStrokeTransparency = 0
  2369. TextButton8.TextWrap = true
  2370. TextButton8.TextWrapped = true
  2371. TextButton9.Name = "n3"
  2372. TextButton9.Parent = module_screen
  2373. TextButton9.Position = UDim2.new(0.452513993, 0, 0.660804033, 0)
  2374. TextButton9.Size = UDim2.new(0, 100, 0, 100)
  2375. TextButton9.BackgroundColor = BrickColor.new("Earth green")
  2376. TextButton9.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
  2377. TextButton9.Font = Enum.Font.Merriweather
  2378. TextButton9.FontSize = Enum.FontSize.Size14
  2379. TextButton9.Text = "III"
  2380. TextButton9.TextColor = BrickColor.new("Institutional white")
  2381. TextButton9.TextColor3 = Color3.new(1, 1, 1)
  2382. TextButton9.TextScaled = true
  2383. TextButton9.TextSize = 14
  2384. TextButton9.TextStrokeTransparency = 0
  2385. TextButton9.TextWrap = true
  2386. TextButton9.TextWrapped = true
  2387. TextButton10.Name = "n4"
  2388. TextButton10.Parent = module_screen
  2389. TextButton10.Position = UDim2.new(0.661080122, 0, 0.660804033, 0)
  2390. TextButton10.Size = UDim2.new(0, 100, 0, 100)
  2391. TextButton10.BackgroundColor = BrickColor.new("Earth green")
  2392. TextButton10.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
  2393. TextButton10.Font = Enum.Font.Merriweather
  2394. TextButton10.FontSize = Enum.FontSize.Size14
  2395. TextButton10.Text = "IIII"
  2396. TextButton10.TextColor = BrickColor.new("Institutional white")
  2397. TextButton10.TextColor3 = Color3.new(1, 1, 1)
  2398. TextButton10.TextScaled = true
  2399. TextButton10.TextSize = 14
  2400. TextButton10.TextStrokeTransparency = 0
  2401. TextButton10.TextWrap = true
  2402. TextButton10.TextWrapped = true
  2403. TextLabel11.Name = "result"
  2404. TextLabel11.Parent = module_screen
  2405. TextLabel11.Position = UDim2.new(0.150999993, 0, 0.0930000022, 0)
  2406. TextLabel11.Size = UDim2.new(0, 361, 0, 187)
  2407. TextLabel11.BackgroundColor = BrickColor.new("Dirt brown")
  2408. TextLabel11.BackgroundColor3 = Color3.new(0.262745, 0.262745, 0.262745)
  2409. TextLabel11.Font = Enum.Font.Merriweather
  2410. TextLabel11.FontSize = Enum.FontSize.Size14
  2411. wait()
  2412. TextLabel11.Text = "DONE"
  2413. TextLabel11.TextColor = BrickColor.new("Institutional white")
  2414. TextLabel11.TextColor3 = Color3.new(1, 1, 1)
  2415. TextLabel11.TextScaled = true
  2416. TextLabel11.TextSize = 14
  2417. TextLabel11.TextStrokeTransparency = 0
  2418. TextLabel11.TextWrap = true
  2419. TextLabel11.TextWrapped = true
  2420. local to_press = 0
  2421. local pressed = 0
  2422. local passed = 0
  2423. local can_press = true
  2424. if module.finished and dgui and module.id == 'dial' then
  2425. for i = 1,5 do
  2426. module_screen[tostring(i)].BackgroundColor3 = Color3.new(0,1,0)
  2427. end
  2428. return
  2429. end
  2430. for _,button in pairs(module_screen:GetChildren()) do
  2431. if button:IsA("TextButton") then
  2432. button.MouseButton1Click:Connect(function()
  2433. if module.finished or not can_press or module.id ~= 'dial' then
  2434. return
  2435. end
  2436. local click_s = Instance.new("Sound")
  2437. click_s.SoundId = 'rbxassetid://4086020670'
  2438. --click_s.PlaybackSpeed = math.random(100,110)/100
  2439. click_s.Volume = 1
  2440. click_s.Parent = dgui
  2441. click_s:Play()
  2442. pressed = tonumber(string.sub(button.Name,2,2))
  2443. if pressed ~= to_press then
  2444. mistake = true
  2445. local mistake_s = Instance.new("Sound")
  2446. mistake_s.SoundId = 'rbxassetid://1000294392'
  2447. mistake_s.Volume = 1
  2448. mistake_s.Parent = dgui
  2449. mistake_s:Play()
  2450. end
  2451. end)
  2452. end
  2453. end
  2454. for i = 1,5 do
  2455. for i = 1,3 do
  2456. if dgui and module.id == 'dial' then else return end
  2457. pressed = 0
  2458. to_press = math.random(1,4)
  2459. module_screen.result.Text = string.rep('I',to_press)
  2460. repeat wait(0.1) until pressed > 0
  2461. if dgui and module.id == 'dial' then else return end
  2462. end
  2463. passed = passed + 1
  2464. if dgui and module.id == 'dial' then else return end
  2465. module_screen[tostring(passed)].BackgroundColor3 = Color3.new(0,1,0)
  2466. end
  2467. if not module.finished and not mistake and dgui and module.id == 'dial' then
  2468. module.finished = true
  2469. local click_s = Instance.new("Sound")
  2470. click_s.SoundId = 'rbxassetid://317553816'
  2471. click_s.Volume = 1
  2472. click_s.Parent = dgui
  2473. click_s:Play()
  2474. local cm = 0
  2475. for i,v in pairs(modules) do
  2476. if v.finished then
  2477. cm = cm + 1
  2478. end
  2479. end
  2480. completed_modules = cm
  2481. end
  2482. if module.finished then
  2483. module_screen.result.Text = 'DONE'
  2484. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  2485. end
  2486. elseif module.id == 'wire' then
  2487. local Frame0 = Instance.new("Frame")
  2488. local Frame1 = Instance.new("Frame")
  2489. local Frame2 = Instance.new("Frame")
  2490. local Frame3 = Instance.new("Frame")
  2491. local Frame4 = Instance.new("Frame")
  2492. local Frame5 = Instance.new("Frame")
  2493. local TextButton6 = Instance.new("TextButton")
  2494. local TextButton7 = Instance.new("TextButton")
  2495. local TextLabel8 = Instance.new("TextBox")
  2496. local TextButton9 = Instance.new("TextButton")
  2497. Frame0.Parent = module_screen
  2498. Frame0.Position = UDim2.new(0.115456238, 0, 0.138190955, 0)
  2499. Frame0.Size = UDim2.new(0, 35, 0, 35)
  2500. Frame0.BackgroundColor = BrickColor.new("Black")
  2501. Frame0.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  2502. Frame0.ZIndex = 2
  2503. Frame1.Parent = module_screen
  2504. Frame1.Position = UDim2.new(0.11359404, 0, 0.457286447, 0)
  2505. Frame1.Size = UDim2.new(0, 35, 0, 35)
  2506. Frame1.BackgroundColor = BrickColor.new("Black")
  2507. Frame1.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  2508. Frame1.ZIndex = 2
  2509. Frame2.Parent = module_screen
  2510. Frame2.Position = UDim2.new(0.115456238, 0, 0.771356761, 0)
  2511. Frame2.Size = UDim2.new(0, 35, 0, 35)
  2512. Frame2.BackgroundColor = BrickColor.new("Black")
  2513. Frame2.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  2514. Frame2.ZIndex = 2
  2515. Frame3.Parent = module_screen
  2516. Frame3.Position = UDim2.new(0.821229041, 0, 0.138190955, 0)
  2517. Frame3.Size = UDim2.new(0, 35, 0, 35)
  2518. Frame3.BackgroundColor = BrickColor.new("Black")
  2519. Frame3.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  2520. Frame3.ZIndex = 2
  2521. Frame4.Parent = module_screen
  2522. Frame4.Position = UDim2.new(0.821229041, 0, 0.771356761, 0)
  2523. Frame4.Size = UDim2.new(0, 35, 0, 35)
  2524. Frame4.BackgroundColor = BrickColor.new("Black")
  2525. Frame4.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  2526. Frame4.ZIndex = 2
  2527. Frame5.Parent = module_screen
  2528. Frame5.Position = UDim2.new(0.819366872, 0, 0.457286447, 0)
  2529. Frame5.Size = UDim2.new(0, 35, 0, 35)
  2530. Frame5.BackgroundColor = BrickColor.new("Black")
  2531. Frame5.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  2532. Frame5.ZIndex = 2
  2533. TextButton6.Name = "blue"
  2534. TextButton6.Parent = module_screen
  2535. TextButton6.Position = UDim2.new(0.137802601, 0, 0.48241201, 0)
  2536. TextButton6.Size = UDim2.new(0, 387, 0, 15)
  2537. TextButton6.BackgroundColor = BrickColor.new("Really blue")
  2538. TextButton6.BackgroundColor3 = Color3.new(0, 0, 1)
  2539. TextButton6.BorderColor = BrickColor.new("Really black")
  2540. TextButton6.BorderColor3 = Color3.new(0, 0, 0)
  2541. TextButton6.BorderSizePixel = 2
  2542. TextButton6.Font = Enum.Font.SourceSans
  2543. TextButton6.FontSize = Enum.FontSize.Size14
  2544. TextButton6.Text = "GREEN"
  2545. TextButton6.TextColor = BrickColor.new("Institutional white")
  2546. TextButton6.TextColor3 = Color3.new(1, 1, 1)
  2547. TextButton6.TextScaled = true
  2548. TextButton6.TextSize = 14
  2549. TextButton6.TextStrokeTransparency = 0
  2550. TextButton6.TextWrap = true
  2551. TextButton6.TextWrapped = true
  2552. TextButton7.Name = "green"
  2553. TextButton7.Parent = module_screen
  2554. TextButton7.Position = UDim2.new(0.139664799, 0, 0.796482384, 0)
  2555. TextButton7.Size = UDim2.new(0, 387, 0, 15)
  2556. TextButton7.BackgroundColor = BrickColor.new("Lime green")
  2557. TextButton7.BackgroundColor3 = Color3.new(0, 1, 0)
  2558. TextButton7.BorderColor = BrickColor.new("Really black")
  2559. TextButton7.BorderColor3 = Color3.new(0, 0, 0)
  2560. TextButton7.BorderSizePixel = 2
  2561. TextButton7.Font = Enum.Font.SourceSans
  2562. TextButton7.FontSize = Enum.FontSize.Size14
  2563. TextButton7.Text = "RED"
  2564. TextButton7.TextColor = BrickColor.new("Institutional white")
  2565. TextButton7.TextColor3 = Color3.new(1, 1, 1)
  2566. TextButton7.TextScaled = true
  2567. TextButton7.TextSize = 14
  2568. TextButton7.TextStrokeTransparency = 0
  2569. TextButton7.TextWrap = true
  2570. TextButton7.TextWrapped = true
  2571. TextLabel8.Name = "title"
  2572. TextLabel8.Parent = module_screen
  2573. TextLabel8.Position = UDim2.new(0.00186219742, 0, 0, 0)
  2574. TextLabel8.Size = UDim2.new(0, 536, 0, 55)
  2575. TextLabel8.BackgroundColor = BrickColor.new("Institutional white")
  2576. TextLabel8.BackgroundColor3 = Color3.new(1, 1, 1)
  2577. TextLabel8.BackgroundTransparency = 1
  2578. TextLabel8.Font = Enum.Font.SourceSans
  2579. TextLabel8.FontSize = Enum.FontSize.Size14
  2580. TextLabel8.TextColor = BrickColor.new("Institutional white")
  2581. TextLabel8.TextColor3 = Color3.new(1, 1, 1)
  2582. TextLabel8.TextScaled = true
  2583. TextLabel8.TextSize = 14
  2584. TextLabel8.TextStrokeTransparency = 0
  2585. TextLabel8.TextWrap = true
  2586. TextLabel8.TextWrapped = true
  2587. TextButton9.Name = "red"
  2588. TextButton9.Parent = module_screen
  2589. TextButton9.Position = UDim2.new(0.143389195, 0, 0.163316578, 0)
  2590. TextButton9.Size = UDim2.new(0, 387, 0, 15)
  2591. TextButton9.BackgroundColor = BrickColor.new("Really red")
  2592. TextButton9.BackgroundColor3 = Color3.new(1, 0, 0)
  2593. TextButton9.BorderColor = BrickColor.new("Really black")
  2594. TextButton9.BorderColor3 = Color3.new(0, 0, 0)
  2595. TextButton9.BorderSizePixel = 2
  2596. TextButton9.Font = Enum.Font.SourceSans
  2597. TextButton9.FontSize = Enum.FontSize.Size14
  2598. TextButton9.Text = "BLUE"
  2599. TextButton9.TextColor = BrickColor.new("Institutional white")
  2600. TextButton9.TextColor3 = Color3.new(1, 1, 1)
  2601. TextButton9.TextScaled = true
  2602. TextButton9.TextSize = 14
  2603. TextButton9.TextStrokeTransparency = 0
  2604. TextButton9.TextWrap = true
  2605. TextButton9.TextWrapped = true
  2606. pcall(function()
  2607. wait()
  2608. module_screen.title.Text = string.upper(module.text)
  2609. end)
  2610. for _,button in pairs(module_screen:GetChildren()) do
  2611. if button:IsA("TextButton") then
  2612. if module.clicked[button.Name] then
  2613. button:Destroy()
  2614. end
  2615. button.MouseButton1Click:Connect(function()
  2616. if module.finished then
  2617. return
  2618. end
  2619. local click_s = Instance.new("Sound")
  2620. click_s.SoundId = 'rbxassetid://5124453445'
  2621. click_s.Volume = 1
  2622. click_s.Parent = dgui
  2623. click_s:Play()
  2624. module.clicked[button.Name] = true
  2625. button:Destroy()
  2626. if not module.finished then
  2627. if module.color == button.Name then
  2628. module.finished = true
  2629. local click_s = Instance.new("Sound")
  2630. click_s.SoundId = 'rbxassetid://317553816'
  2631. click_s.Volume = 1
  2632. click_s.Parent = dgui
  2633. click_s:Play()
  2634. local cm = 0
  2635. for i,v in pairs(modules) do
  2636. if v.finished then
  2637. cm = cm + 1
  2638. end
  2639. end
  2640. completed_modules = cm
  2641. else
  2642. mistake = true
  2643. local mistake_s = Instance.new("Sound")
  2644. mistake_s.SoundId = 'rbxassetid://1000294392'
  2645. mistake_s.Volume = 1
  2646. mistake_s.Parent = dgui
  2647. mistake_s:Play()
  2648. end
  2649. end
  2650. if module.finished then
  2651. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  2652. end
  2653. end)
  2654. end
  2655. end
  2656. elseif module.id == 'hold' then
  2657. local TextButton0 = Instance.new("TextButton")
  2658. TextButton0.Parent = module_screen
  2659. TextButton0.Position = UDim2.new(0.314711362, 0, 0.527638197, 0)
  2660. TextButton0.Size = UDim2.new(0, 200, 0, 114)
  2661. TextButton0.BackgroundColor = BrickColor.new("Silver flip/flop")
  2662. TextButton0.BackgroundColor3 = Color3.new(0.541176, 0.541176, 0.541176)
  2663. TextButton0.Font = Enum.Font.SourceSans
  2664. TextButton0.FontSize = Enum.FontSize.Size14
  2665. TextButton0.TextColor = BrickColor.new("Really black")
  2666. TextButton0.TextColor3 = Color3.new(0, 0, 0)
  2667. TextButton0.TextScaled = true
  2668. TextButton0.TextSize = 14
  2669. TextButton0.TextWrap = true
  2670. TextButton0.TextWrapped = true
  2671. if not module.finished then
  2672. TextButton0.Text = "HOLD"
  2673. else
  2674. TextButton0.Text = "DONE"
  2675. return
  2676. end
  2677. local hid = 0
  2678. TextButton0.MouseButton1Down:Connect(function()
  2679. hid = hid + 1
  2680. local cid = hid
  2681. if not module.finished then
  2682. TextButton0.Text = "HOLD"
  2683. else
  2684. --TextButton0.Text = "DONE"
  2685. return
  2686. end
  2687. local hold_s = Instance.new("Sound")
  2688. hold_s.SoundId = 'rbxassetid://133116870'
  2689. hold_s.PlaybackSpeed = 0.1
  2690. hold_s.Volume = 1
  2691. hold_s.Looped = true
  2692. hold_s.Parent = dgui
  2693. hold_s:Play()
  2694. for i = module.time,0,-1 do
  2695. if hid == cid then else break end
  2696. if dgui and module.id == 'hold' then else return end
  2697. --TextButton0.Text = "HOLD"
  2698. game:GetService("TweenService"):Create(hold_s,TweenInfo.new(1),{PlaybackSpeed = hold_s.PlaybackSpeed+0.1}):Play()
  2699. if 0 >= i and not module.finished then
  2700. module.finished = true
  2701. local click_s = Instance.new("Sound")
  2702. click_s.SoundId = 'rbxassetid://317553816'
  2703. click_s.Volume = 1
  2704. click_s.Parent = dgui
  2705. click_s:Play()
  2706. local cm = 0
  2707. for i,v in pairs(modules) do
  2708. if v.finished then
  2709. cm = cm + 1
  2710. end
  2711. end
  2712. completed_modules = cm
  2713. end
  2714. wait(1)
  2715. end
  2716. hold_s:Destroy()
  2717. if dgui and module.id == 'hold' then else return end
  2718. if module.finished then
  2719. module_screen.BackgroundColor3 = Color3.new(0,1,0)
  2720. TextButton0.Text = "DONE"
  2721. else
  2722. mistake = true
  2723. local mistake_s = Instance.new("Sound")
  2724. mistake_s.SoundId = 'rbxassetid://1000294392'
  2725. mistake_s.Volume = 1
  2726. mistake_s.Parent = dgui
  2727. mistake_s:Play()
  2728. --TextButton0.Text = "HOLD"
  2729. end
  2730. end)
  2731. TextButton0.MouseButton1Up:Connect(function()
  2732. hid = hid + 1
  2733. end)
  2734. end
  2735. end
  2736.  
  2737. spawn(function()
  2738. load_module()
  2739. end)
  2740.  
  2741. previous.MouseButton1Click:Connect(function()
  2742. id = id - 1
  2743. if 1 > id then
  2744. id = #modules
  2745. end
  2746. module = modules[id]
  2747. spawn(function()
  2748. load_module()
  2749. end)
  2750. end)
  2751. after.MouseButton1Click:Connect(function()
  2752. id = id + 1
  2753. if id > #modules then
  2754. id = 1
  2755. end
  2756. module = modules[id]
  2757. spawn(function()
  2758. load_module()
  2759. end)
  2760. end)
  2761. pcall(function()
  2762. wait()
  2763. TextButton2.Text = "<"
  2764. TextButton3.Text = ">"
  2765. end)
  2766. end
  2767. end
  2768.  
  2769. function plant()
  2770. local currentplr = plr
  2771. planting:Play()
  2772. local pars = nil
  2773. repeat
  2774. wait()
  2775. local rp = RaycastParams.new()
  2776. rp.FilterType = Enum.RaycastFilterType.Blacklist
  2777. rp.FilterDescendantsInstances = {script,char,Tool0}
  2778. rp.IgnoreWater = true
  2779. pars = workspace:Raycast(torso.Position,torso.CFrame.upVector*-1*3.5,rp)
  2780. until (planting.TimePosition >= 3 or not planting.IsPlaying) or (currentplr ~= plr or not CheckIfAlive or not equipped or not using or not pars)
  2781. if (currentplr ~= plr or not CheckIfAlive or not equipped or not using or not pars) then
  2782. planting:Stop();
  2783. using = false
  2784. return;
  2785. end
  2786. planted:Play()
  2787. local bomb = handle:Clone()
  2788. bomb.Anchored = false
  2789. bomb.CanCollide = true
  2790. bomb.CFrame = CFrame.new(pars.Position+Vector3.new(0,bomb.Size.Y/2,0))
  2791. bomb.Parent = script
  2792. local weld = Instance.new("Weld")
  2793. weld.Part0 = pars.Instance
  2794. weld.Part1 = bomb
  2795. weld.C0 = pars.Instance.CFrame:Inverse()
  2796. weld.C1 = bomb.CFrame:Inverse()
  2797. weld.Parent = bomb
  2798. if bomb and bomb.Parent then
  2799. tool:Destroy()
  2800. for i = 1,6 do
  2801. create_module()
  2802. end
  2803. local clicker = Instance.new("ClickDetector")
  2804. clicker.MaxActivationDistance = defuse_dist
  2805. clicker.MouseClick:Connect(function(targplr)
  2806. if (completed_modules < total_modules) then else return end
  2807. local targchar,targtorso,targhum
  2808. pcall(function()
  2809. targchar = targplr.Character
  2810. end)
  2811. pcall(function()
  2812. targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("LowerTorso") or targchar:FindFirstChild("HumanoidRootPart")
  2813. end)
  2814. pcall(function()
  2815. targhum = targchar:FindFirstChildOfClass("Humanoid")
  2816. end)
  2817. if targplr and targchar and targtorso and targhum and targhum.Health > 0 then
  2818. create_gui(targplr,targtorso,bomb)
  2819. end
  2820. end)
  2821. clicker.Parent = bomb
  2822. timer(bomb)
  2823. end
  2824. end
  2825.  
  2826. tool.Equipped:Connect(function()
  2827. char = tool.Parent
  2828. plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  2829. hum = char:FindFirstChildOfClass("Humanoid")
  2830. torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  2831. if not CheckIfAlive() then tool.Parent = nil return end
  2832. equipped = true
  2833. equip:Play()
  2834. end)
  2835.  
  2836. tool.Unequipped:Connect(function()
  2837. equipped = false
  2838. using = false
  2839. equip:Stop()
  2840. end)
  2841.  
  2842. tool.Activated:Connect(function()
  2843. if not using then
  2844. using = true
  2845. plant()
  2846. end
  2847. end)
  2848.  
  2849. function CheckIfAlive()
  2850. local alive = false
  2851. if (plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and torso and torso.Parent) then
  2852. alive = true
  2853. end
  2854. return alive
  2855. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement