Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print([[
- = defusal bomb made by KrYn0MoRe =
- - Unique modules to solve
- - Teamwork can be done
- - 1 mistake and you're out
- ]])
- local plr = owner
- local char = plr.Character
- local hum = char:FindFirstChildOfClass("Humanoid")
- local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
- debris = game:GetService("Debris")
- tween = game:GetService("TweenService")
- local ToolEquipped = false
- local holding = false
- local equipped = false
- local using = false
- local Tool0 = Instance.new("Tool")
- local Part1 = Instance.new("Part")
- local SpecialMesh2 = Instance.new("SpecialMesh")
- Tool0.Name = "C4"
- Tool0.Parent = plr['Backpack']
- Tool0.TextureId = "rbxassetid://172171690"
- 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)
- Tool0.ToolTip = "Plant the bomb, complete the objective."
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(0.0049970001, 0.340999991, -0.00151099998, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.Position = Vector3.new(0.0049970001, 0.340999991, -0.00151099998)
- Part1.Size = Vector3.new(1.59000003, 0.681999981, 2.26300001)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "rbxassetid://454801145"
- SpecialMesh2.Scale = Vector3.new(0.00200000009, 0.00200000009, 0.00200000009)
- SpecialMesh2.TextureId = "rbxassetid://454801149"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- local handle = Part1
- local tool = Tool0
- local equip = Instance.new("Sound",handle)
- equip.SoundId = "rbxassetid://169799883"
- equip.Volume = 1
- local planting = Instance.new("Sound",handle)
- planting.SoundId = "rbxassetid://340617924"
- planting.Volume = 1
- local planted = Instance.new("Sound",script)
- planted.SoundId = "rbxassetid://180746510"
- planted.Volume = 2
- local modules = {}
- local themes = {1837828275,1842961789,1837828288,1839549205,1839549180}
- local defuse_dist = 6
- local max_time = 60*1.5
- local completed_modules = 0
- local total_modules = 0
- local countdown = max_time
- local mistake = false
- function ex_fx(item)
- local Gate
- local function hit(hit)
- if hit then
- local Effect = Instance.new("SelectionBox",script)
- if item.Visible then
- Effect.Color3 = Color3.fromRGB(255,150,0)
- Effect.SurfaceColor3 = Color3.fromRGB(255,215,0)
- Effect.Transparency = 0.67
- Effect.SurfaceTransparency = 0.73
- else
- Effect.Color3 = Color3.fromRGB(0,100,255)
- Effect.SurfaceColor3 = Color3.fromRGB(0,60,215)
- Effect.Transparency = 0.8
- Effect.SurfaceTransparency = 0.9
- end
- Effect.Adornee = hit
- Effect.Archivable = false
- game:GetService("Debris"):AddItem(Effect,math.random(150,350) / 100)
- end
- end
- item.Hit:connect(hit)
- wait()
- if item.Visible == false then
- Gate = false
- else
- Gate = true
- end
- local EffectPart = Instance.new("Part",script)
- EffectPart.Archivable = false
- EffectPart.Size = Vector3.new(0.125,0.125,0.125)
- EffectPart.CanCollide = false
- EffectPart.Anchored = true
- EffectPart.Archivable = false
- EffectPart.Locked = true
- EffectPart.CFrame = CFrame.new(0,0,0)
- EffectPart.Name = "Effect"
- EffectPart.Material = Enum.Material.Neon
- EffectPart.Transparency = 0.25
- EffectPart.BrickColor = BrickColor.new("Neon orange")
- EffectPart.TopSurface = Enum.SurfaceType.Unjoinable
- EffectPart.BottomSurface = Enum.SurfaceType.Unjoinable
- EffectPart.LeftSurface = Enum.SurfaceType.Unjoinable
- EffectPart.RightSurface = Enum.SurfaceType.Unjoinable
- EffectPart.FrontSurface = Enum.SurfaceType.Unjoinable
- EffectPart.BackSurface = Enum.SurfaceType.Unjoinable
- local Effect = Instance.new("SpecialMesh")
- Effect.Parent = EffectPart
- Effect.MeshType = Enum.MeshType.Sphere
- Effect.Offset = Vector3.new(item.Position.X,item.Position.Y,item.Position.Z)
- local Attachment = Instance.new("Attachment",EffectPart)
- Attachment.Position = Vector3.new(item.Position.X,item.Position.Y,item.Position.Z)
- local Alternate = true
- for i = 1,20 do
- wait(0.02)
- Alternate = not Alternate
- if EffectPart then
- if Alternate then
- if Gate then
- EffectPart.Transparency = 0
- EffectPart.BrickColor = BrickColor.new("Cool yellow")
- else
- EffectPart.Transparency = 0.6
- EffectPart.BrickColor = BrickColor.new("Cyan")
- end
- else
- if Gate then
- EffectPart.Transparency = 0.25
- EffectPart.BrickColor = BrickColor.new("Neon orange")
- else
- EffectPart.Transparency = 0.8
- EffectPart.BrickColor = BrickColor.new("Bright blue")
- end
- end
- end
- if Effect then
- game:GetService("TweenService"):Create(Effect,TweenInfo.new(0.02),{
- Scale = Vector3.new(item.BlastRadius * (0.8 * i),item.BlastRadius * (0.8 * i),item.BlastRadius * (0.8 * i))
- }):Play()
- end
- end
- for i = 1,10 do
- wait(0.007)
- Alternate = not Alternate
- if EffectPart then
- if Alternate then
- if Gate then
- EffectPart.Transparency = 0
- EffectPart.BrickColor = BrickColor.new("Neon orange")
- else
- EffectPart.Transparency = 0.7
- EffectPart.BrickColor = BrickColor.new("Bright blue")
- end
- else
- if Gate then
- EffectPart.Transparency = 0.25
- EffectPart.BrickColor = BrickColor.new("Bright red")
- else
- EffectPart.Transparency = 0.8
- EffectPart.BrickColor = BrickColor.new("Navy blue")
- end
- end
- end
- if Effect then
- game:GetService("TweenService"):Create(Effect,TweenInfo.new(0.007),{
- Scale = Vector3.new(item.BlastRadius * (16 - (1.6 * i)),item.BlastRadius * (16 - (1.6 * i)),item.BlastRadius * (16 - (1.6 * i)))
- }):Play()
- end
- end
- if EffectPart then
- EffectPart:Destroy()
- end
- end
- function limb_collide(obj,mode)
- if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- --
- local t = {}
- --
- local cb = Instance.new("Part")
- cb.Name = 'limb'
- cb.Transparency = 1
- cb.CanCollide = true
- cb.Anchored = false
- cb.CFrame = obj.CFrame
- cb.Size = obj.Size
- cb.Massless = true
- cb.Locked = true
- game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = cb
- weld.Part1 = obj
- weld.Parent = cb
- obj.Massless = true
- obj.Anchored = false
- if mode or obj:FindFirstChild("Dismembered") then
- cb.Parent = obj -- .Parent
- else
- cb.Parent = script
- table.insert(t,1,cb)
- end
- --
- 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
- local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
- local cb2 = Instance.new("Part")
- cb2.Name = 'limb'
- cb2.Transparency = 1
- cb2.CanCollide = true
- cb2.Anchored = false
- cb2.CFrame = obj.CFrame
- cb2.Size = lv
- cb2.Massless = true
- cb2.Locked = true
- local weld2 = Instance.new("Weld")
- weld2.Part0 = cb
- weld2.Part1 = cb2
- weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
- weld2.Parent = cb2
- if mode or obj:FindFirstChild("Dismembered") then
- cb2.Parent = obj -- .Parent
- else
- cb2.Parent = script
- table.insert(t,1,cb2)
- end
- end
- --
- return t
- end
- function Ragdoll(targchar,headless,insta,kill)
- local pc = targchar
- local targhum = pc:FindFirstChild("Humanoid")
- local js,js2 = {},{}
- for _,obj in pairs(pc:GetDescendants()) do
- if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
- obj.Massless = true
- obj.Locked = true
- end
- end
- if kill == true then
- pc.Archivable = true
- local old_pc = pc
- pc = pc:Clone()
- for i,v in pairs(pc:GetDescendants()) do
- limb_collide(v,true)
- if v:IsA("ParticleEmitter") then
- v.Enabled = false
- end
- 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
- if v:IsA("BodyVelocity") then
- game:GetService("Debris"):AddItem(v,0.15)
- else
- v:Destroy()
- end
- end
- if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
- v:Destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = false
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- for i,v in pairs(old_pc:GetDescendants()) do
- 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
- v:destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = true
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- pc.Parent = workspace
- game:GetService("Debris"):AddItem(pc,15)
- end
- if pc ~= nil then
- local hum = pc:FindFirstChild'Humanoid'
- local LArm = pc:FindFirstChild'Left Arm'
- local RArm = pc:FindFirstChild'Right Arm'
- local LLeg = pc:FindFirstChild'Left Leg'
- local RLeg = pc:FindFirstChild'Right Leg'
- local torso = pc:FindFirstChild'Torso'
- local head = pc:FindFirstChild'Head'
- local LUA = pc:FindFirstChild'LeftUpperArm'
- local LLA = pc:FindFirstChild'LeftLowerArm'
- local LH = pc:FindFirstChild'LeftHand'
- local RUA = pc:FindFirstChild'RightUpperArm'
- local RLA = pc:FindFirstChild'RightLowerArm'
- local RH = pc:FindFirstChild'RightHand'
- local LUL = pc:FindFirstChild'LeftUpperLeg'
- local LLL = pc:FindFirstChild'LeftLowerLeg'
- local LF = pc:FindFirstChild'LeftFoot'
- local RUL = pc:FindFirstChild'RightUpperLeg'
- local RLL = pc:FindFirstChild'RightLowerLeg'
- local RF = pc:FindFirstChild'RightFoot'
- local UT = pc:FindFirstChild'UpperTorso'
- local LT = pc:FindFirstChild'LowerTorso'
- if hum and LArm and RArm and LLeg and RLeg and head then
- hum.BreakJointsOnDeath = false
- if insta then
- if hum.RigType==Enum.HumanoidRigType.R6 then
- for _,v in pairs(torso:GetDescendants()) do
- 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
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LArm and not LArm:FindFirstChild('Dismembered') then
- local at1 = Instance.new("Attachment")
- at1.Parent = torso
- at1.Visible = vis
- at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
- at1.Position = Vector3.new(-1,1,0)
- local at1p2 = Instance.new("Attachment")
- at1p2.Parent = LArm
- at1p2.Visible = vis
- at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
- at1p2.Position = Vector3.new(.5,1,0)
- local bis = Instance.new("BallSocketConstraint")
- bis.Parent = LArm
- bis.Attachment0 = at1
- bis.Attachment1 = at1p2
- bis.LimitsEnabled = true
- bis.UpperAngle = 15
- bis.Visible = vis2
- bis.TwistLimitsEnabled = true
- bis.UpperAngle = -45
- bis.TwistLowerAngle = -45
- table.insert(js,1,bis)
- end
- if RArm and not RArm:FindFirstChild('Dismembered') then
- local at2 = Instance.new("Attachment")
- at2.Parent = torso
- at2.Visible = vis
- at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
- at2.Position = Vector3.new(1,1,0)
- local at2p2 = Instance.new("Attachment")
- at2p2.Parent = RArm
- at2p2.Visible = vis
- at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
- at2p2.Position = Vector3.new(-.5,1,0)
- local bis2 = Instance.new("BallSocketConstraint")
- bis2.Parent = RArm
- bis2.Attachment0 = at2
- bis2.Attachment1 = at2p2
- bis2.LimitsEnabled = true
- bis2.UpperAngle = 15
- bis2.Visible = vis2
- bis2.TwistLimitsEnabled = true
- bis2.UpperAngle = -45
- bis2.TwistLowerAngle = -45
- table.insert(js,1,bis2)
- end
- if RLeg and not RLeg:FindFirstChild('Dismembered') then
- local at3 = Instance.new("Attachment")
- at3.Parent = torso
- at3.Visible = vis
- at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at3.Position = Vector3.new(.5,-1,0)
- local at3p2 = Instance.new("Attachment")
- at3p2.Parent = RLeg
- at3p2.Visible = vis
- at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
- at3p2.Position = Vector3.new(0,1,0)
- local bis3 = Instance.new("BallSocketConstraint")
- bis3.Parent = RLeg
- bis3.Attachment0 = at3
- bis3.Attachment1 = at3p2
- bis3.LimitsEnabled = true
- bis3.UpperAngle = 180-15
- bis3.Visible = vis2
- table.insert(js,1,bis3)
- end
- if LLeg and not LLeg:FindFirstChild('Dismembered') then
- local at4 = Instance.new("Attachment")
- at4.Parent = torso
- at4.Visible = vis
- at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at4.Position = Vector3.new(-.5,-1,0)
- local at4p2 = Instance.new("Attachment")
- at4p2.Parent = LLeg
- at4p2.Visible = vis
- at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
- at4p2.Position = Vector3.new(0,1,0)
- local bis4 = Instance.new("BallSocketConstraint")
- bis4.Parent = LLeg
- bis4.Attachment0 = at4
- bis4.Attachment1 = at4p2
- bis4.LimitsEnabled = true
- bis4.UpperAngle = 180-15
- bis4.Visible = vis2
- table.insert(js,1,bis4)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local at5 = Instance.new("Attachment")
- at5.Parent = torso
- at5.Visible = vis
- at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
- at5.Position = Vector3.new(0,1,0)
- local at5p2 = Instance.new("Attachment")
- at5p2.Parent = head
- at5p2.Visible = vis
- at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
- at5p2.Position = Vector3.new(0,-.5,0)
- local bis5 = Instance.new("BallSocketConstraint")
- bis5.Parent = head
- bis5.Attachment0 = at5p2
- bis5.Attachment1 = at5
- bis5.LimitsEnabled = true
- bis5.UpperAngle = 75
- bis5.Visible = vis2
- bis5.TwistLimitsEnabled = true
- bis5.UpperAngle = -45
- bis5.TwistLowerAngle = -45
- table.insert(js,1,bis5)
- else
- --head:BreakJoints()
- end
- end
- else
- hum.Died:Connect(function()
- if hum.RigType==Enum.HumanoidRigType.R6 then
- for _,v in pairs(torso:GetDescendants()) do
- 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
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LArm and not LArm:FindFirstChild('Dismembered') then
- local at1 = Instance.new("Attachment")
- at1.Parent = torso
- at1.Visible = vis
- at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
- at1.Position = Vector3.new(-1,1,0)
- local at1p2 = Instance.new("Attachment")
- at1p2.Parent = LArm
- at1p2.Visible = vis
- at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
- at1p2.Position = Vector3.new(.5,1,0)
- local bis = Instance.new("BallSocketConstraint")
- bis.Parent = LArm
- bis.Attachment0 = at1
- bis.Attachment1 = at1p2
- bis.LimitsEnabled = true
- bis.UpperAngle = 15
- bis.Visible = vis2
- bis.TwistLimitsEnabled = true
- bis.UpperAngle = -45
- bis.TwistLowerAngle = -45
- table.insert(js,1,bis)
- end
- if RArm and not RArm:FindFirstChild('Dismembered') then
- local at2 = Instance.new("Attachment")
- at2.Parent = torso
- at2.Visible = vis
- at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
- at2.Position = Vector3.new(1,1,0)
- local at2p2 = Instance.new("Attachment")
- at2p2.Parent = RArm
- at2p2.Visible = vis
- at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
- at2p2.Position = Vector3.new(-.5,1,0)
- local bis2 = Instance.new("BallSocketConstraint")
- bis2.Parent = RArm
- bis2.Attachment0 = at2
- bis2.Attachment1 = at2p2
- bis2.LimitsEnabled = true
- bis2.UpperAngle = 15
- bis2.Visible = vis2
- bis2.TwistLimitsEnabled = true
- bis2.UpperAngle = -45
- bis2.TwistLowerAngle = -45
- table.insert(js,1,bis2)
- end
- if RLeg and not RLeg:FindFirstChild('Dismembered') then
- local at3 = Instance.new("Attachment")
- at3.Parent = torso
- at3.Visible = vis
- at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at3.Position = Vector3.new(.5,-1,0)
- local at3p2 = Instance.new("Attachment")
- at3p2.Parent = RLeg
- at3p2.Visible = vis
- at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
- at3p2.Position = Vector3.new(0,1,0)
- local bis3 = Instance.new("BallSocketConstraint")
- bis3.Parent = RLeg
- bis3.Attachment0 = at3
- bis3.Attachment1 = at3p2
- bis3.LimitsEnabled = true
- bis3.UpperAngle = 180-15
- bis3.Visible = vis2
- table.insert(js,1,bis3)
- end
- if LLeg and not LLeg:FindFirstChild('Dismembered') then
- local at4 = Instance.new("Attachment")
- at4.Parent = torso
- at4.Visible = vis
- at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
- at4.Position = Vector3.new(-.5,-1,0)
- local at4p2 = Instance.new("Attachment")
- at4p2.Parent = LLeg
- at4p2.Visible = vis
- at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
- at4p2.Position = Vector3.new(0,1,0)
- local bis4 = Instance.new("BallSocketConstraint")
- bis4.Parent = LLeg
- bis4.Attachment0 = at4
- bis4.Attachment1 = at4p2
- bis4.LimitsEnabled = true
- bis4.UpperAngle = 180-15
- bis4.Visible = vis2
- table.insert(js,1,bis4)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local at5 = Instance.new("Attachment")
- at5.Parent = torso
- at5.Visible = vis
- at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
- at5.Position = Vector3.new(0,1,0)
- local at5p2 = Instance.new("Attachment")
- at5p2.Parent = head
- at5p2.Visible = vis
- at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
- at5p2.Position = Vector3.new(0,-.5,0)
- local bis5 = Instance.new("BallSocketConstraint")
- bis5.Parent = head
- bis5.Attachment0 = at5p2
- bis5.Attachment1 = at5
- bis5.LimitsEnabled = true
- bis5.UpperAngle = 75
- bis5.Visible = vis2
- bis5.TwistLimitsEnabled = true
- bis5.UpperAngle = -45
- bis5.TwistLowerAngle = -45
- table.insert(js,1,bis5)
- else
- --head:BreakJoints()
- end
- end
- end)
- end
- elseif head and hum then
- hum.BreakJointsOnDeath = false
- if insta then
- if hum.RigType==Enum.HumanoidRigType.R15 then
- for _,v in pairs(pc:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LF and not LF:FindFirstChild('Dismembered') then
- local bsc1 = Instance.new("BallSocketConstraint",LF)
- bsc1.Attachment0 = LF.LeftAnkleRigAttachment
- bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
- table.insert(js,1,bsc1)
- end
- if LLL and not LLL:FindFirstChild('Dismembered') then
- local bsc2 = Instance.new("BallSocketConstraint",LLL)
- bsc2.Attachment0 = LLL.LeftKneeRigAttachment
- bsc2.Attachment1 = LUL.LeftKneeRigAttachment
- table.insert(js,1,bsc2)
- end
- if LUL and not LUL:FindFirstChild('Dismembered') then
- local bsc3 = Instance.new("BallSocketConstraint",LUL)
- bsc3.Attachment0 = LUL.LeftHipRigAttachment
- bsc3.Attachment1 = LT.LeftHipRigAttachment
- table.insert(js,1,bsc3)
- end
- if RF and not RF:FindFirstChild('Dismembered') then
- local bsc4 = Instance.new("BallSocketConstraint",RF)
- bsc4.Attachment0 = RF.RightAnkleRigAttachment
- bsc4.Attachment1 = RLL.RightAnkleRigAttachment
- table.insert(js,1,bsc4)
- end
- if RLL and not RLL:FindFirstChild('Dismembered') then
- local bsc5 = Instance.new("BallSocketConstraint",RLL)
- bsc5.Attachment0 = RLL.RightKneeRigAttachment
- bsc5.Attachment1 = RUL.RightKneeRigAttachment
- table.insert(js,1,bsc5)
- end
- if RUL and not RUL:FindFirstChild('Dismembered') then
- local bsc6 = Instance.new("BallSocketConstraint",RUL)
- bsc6.Attachment0 = RUL.RightHipRigAttachment
- bsc6.Attachment1 = LT.RightHipRigAttachment
- table.insert(js,1,bsc6)
- end
- if LH and not LH:FindFirstChild('Dismembered') then
- local bsc7 = Instance.new("BallSocketConstraint",LH)
- bsc7.Attachment0 = LH.LeftWristRigAttachment
- bsc7.Attachment1 = LLA.LeftWristRigAttachment
- table.insert(js,1,bsc7)
- end
- if LLA and not LLA:FindFirstChild('Dismembered') then
- local bsc8 = Instance.new("BallSocketConstraint",LLA)
- bsc8.Attachment0 = LLA.LeftElbowRigAttachment
- bsc8.Attachment1 = LUA.LeftElbowRigAttachment
- table.insert(js,1,bsc8)
- end
- if LUA and not LUA:FindFirstChild('Dismembered') then
- local bsc9 = Instance.new("BallSocketConstraint",LUA)
- bsc9.Attachment0 = LUA.LeftShoulderAttachment
- bsc9.Attachment1 = UT.LeftCollarAttachment
- table.insert(js,1,bsc9)
- end
- if RH and not RH:FindFirstChild('Dismembered') then
- local bsc10 = Instance.new("BallSocketConstraint",RH)
- bsc10.Attachment0 = RH.RightWristRigAttachment
- bsc10.Attachment1 = RLA.RightWristRigAttachment
- table.insert(js,1,bsc10)
- end
- if RLA and not RLA:FindFirstChild('Dismembered') then
- local bsc11 = Instance.new("BallSocketConstraint",RLA)
- bsc11.Attachment0 = RLA.RightElbowRigAttachment
- bsc11.Attachment1 = RUA.RightElbowRigAttachment
- table.insert(js,1,bsc11)
- end
- if RUA and not RUA:FindFirstChild('Dismembered') then
- local bsc12 = Instance.new("BallSocketConstraint",RUA)
- bsc12.Attachment0 = RUA.RightShoulderAttachment
- bsc12.Attachment1 = UT.RightCollarAttachment
- table.insert(js,1,bsc12)
- end
- if LT and not LT:FindFirstChild('Dismembered') then
- local bsc13 = Instance.new("BallSocketConstraint",LT)
- bsc13.Attachment0 = LT.WaistRigAttachment
- bsc13.Attachment1 = UT.WaistRigAttachment
- table.insert(js,1,bsc13)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local bsc14 = Instance.new("BallSocketConstraint",head)
- bsc14.Attachment0 = UT.NeckRigAttachment
- bsc14.Attachment1 = head.NeckRigAttachment
- bsc14.LimitsEnabled = true
- bsc14.UpperAngle = -75
- bsc14.TwistLimitsEnabled = true
- bsc14.UpperAngle = -45
- bsc14.TwistLowerAngle = -45
- table.insert(js,1,bsc14)
- else
- --head:BreakJoints()
- end
- end
- else
- hum.Died:Connect(function()
- if hum.RigType==Enum.HumanoidRigType.R15 then
- for _,v in pairs(pc:GetDescendants()) do
- if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- v.Parent = nil
- elseif kill then
- v:Destroy()
- end
- end
- end
- local vis = false
- local vis2 = false
- if LF and not LF:FindFirstChild('Dismembered') then
- local bsc1 = Instance.new("BallSocketConstraint",LF)
- bsc1.Attachment0 = LF.LeftAnkleRigAttachment
- bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
- table.insert(js,1,bsc1)
- end
- if LLL and not LLL:FindFirstChild('Dismembered') then
- local bsc2 = Instance.new("BallSocketConstraint",LLL)
- bsc2.Attachment0 = LLL.LeftKneeRigAttachment
- bsc2.Attachment1 = LUL.LeftKneeRigAttachment
- table.insert(js,1,bsc2)
- end
- if LUL and not LUL:FindFirstChild('Dismembered') then
- local bsc3 = Instance.new("BallSocketConstraint",LUL)
- bsc3.Attachment0 = LUL.LeftHipRigAttachment
- bsc3.Attachment1 = LT.LeftHipRigAttachment
- table.insert(js,1,bsc3)
- end
- if RF and not RF:FindFirstChild('Dismembered') then
- local bsc4 = Instance.new("BallSocketConstraint",RF)
- bsc4.Attachment0 = RF.RightAnkleRigAttachment
- bsc4.Attachment1 = RLL.RightAnkleRigAttachment
- table.insert(js,1,bsc4)
- end
- if RLL and not RLL:FindFirstChild('Dismembered') then
- local bsc5 = Instance.new("BallSocketConstraint",RLL)
- bsc5.Attachment0 = RLL.RightKneeRigAttachment
- bsc5.Attachment1 = RUL.RightKneeRigAttachment
- table.insert(js,1,bsc5)
- end
- if RUL and not RUL:FindFirstChild('Dismembered') then
- local bsc6 = Instance.new("BallSocketConstraint",RUL)
- bsc6.Attachment0 = RUL.RightHipRigAttachment
- bsc6.Attachment1 = LT.RightHipRigAttachment
- table.insert(js,1,bsc6)
- end
- if LH and not LH:FindFirstChild('Dismembered') then
- local bsc7 = Instance.new("BallSocketConstraint",LH)
- bsc7.Attachment0 = LH.LeftWristRigAttachment
- bsc7.Attachment1 = LLA.LeftWristRigAttachment
- table.insert(js,1,bsc7)
- end
- if LLA and not LLA:FindFirstChild('Dismembered') then
- local bsc8 = Instance.new("BallSocketConstraint",LLA)
- bsc8.Attachment0 = LLA.LeftElbowRigAttachment
- bsc8.Attachment1 = LUA.LeftElbowRigAttachment
- table.insert(js,1,bsc8)
- end
- if LUA and not LUA:FindFirstChild('Dismembered') then
- local bsc9 = Instance.new("BallSocketConstraint",LUA)
- bsc9.Attachment0 = LUA.LeftShoulderAttachment
- bsc9.Attachment1 = UT.LeftCollarAttachment
- table.insert(js,1,bsc9)
- end
- if RH and not RH:FindFirstChild('Dismembered') then
- local bsc10 = Instance.new("BallSocketConstraint",RH)
- bsc10.Attachment0 = RH.RightWristRigAttachment
- bsc10.Attachment1 = RLA.RightWristRigAttachment
- table.insert(js,1,bsc10)
- end
- if RLA and not RLA:FindFirstChild('Dismembered') then
- local bsc11 = Instance.new("BallSocketConstraint",RLA)
- bsc11.Attachment0 = RLA.RightElbowRigAttachment
- bsc11.Attachment1 = RUA.RightElbowRigAttachment
- table.insert(js,1,bsc11)
- end
- if RUA and not RUA:FindFirstChild('Dismembered') then
- local bsc12 = Instance.new("BallSocketConstraint",RUA)
- bsc12.Attachment0 = RUA.RightShoulderAttachment
- bsc12.Attachment1 = UT.RightCollarAttachment
- table.insert(js,1,bsc12)
- end
- if LT and not LT:FindFirstChild('Dismembered') then
- local bsc13 = Instance.new("BallSocketConstraint",LT)
- bsc13.Attachment0 = LT.WaistRigAttachment
- bsc13.Attachment1 = UT.WaistRigAttachment
- table.insert(js,1,bsc13)
- end
- if head and not headless and not head:FindFirstChild('Dismembered') then
- local bsc14 = Instance.new("BallSocketConstraint",head)
- bsc14.Attachment0 = UT.NeckRigAttachment
- bsc14.Attachment1 = head.NeckRigAttachment
- bsc14.LimitsEnabled = true
- bsc14.UpperAngle = -75
- bsc14.TwistLimitsEnabled = true
- bsc14.UpperAngle = -45
- bsc14.TwistLowerAngle = -45
- table.insert(js,1,bsc14)
- else
- --head:BreakJoints()
- end
- end
- end)
- end
- end
- end
- return js,js2
- end
- 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
- local e_s = 1
- function add_decal(f,t,obj)
- spawn(function()
- local texture = Instance.new("Texture")
- texture.Parent = obj
- texture.Face = f
- texture.Texture = 'rbxassetid://' .. t
- if f == 'Left' or f == 'Right' then
- texture.StudsPerTileV = obj.Size.Y + e_s
- if (obj.Size.X > obj.Size.Z) then
- texture.StudsPerTileV = obj.Size.Z + e_s
- elseif (obj.Size.Z > obj.Size.X) then
- texture.StudsPerTileU = obj.Size.X + e_s
- else
- texture.StudsPerTileU = obj.Size.X + e_s
- end
- elseif f == 'Front' or f == 'Back' then
- texture.StudsPerTileV = obj.Size.Y + e_s
- if (obj.Size.X > obj.Size.Z) then
- texture.StudsPerTileV = obj.Size.X + e_s
- elseif (obj.Size.Z > obj.Size.X) then
- texture.StudsPerTileU = obj.Size.Z + e_s
- else
- texture.StudsPerTileU = obj.Size.X + e_s
- end
- elseif f == 'Top' or f == 'Bottom' then
- texture.StudsPerTileV = obj.Size.X + e_s
- texture.StudsPerTileU = obj.Size.Z + e_s
- end
- end)
- end
- function add_blood(obj)
- 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)]
- add_decal('Top',t1,obj)
- add_decal('Bottom',t2,obj)
- add_decal('Left',t3,obj)
- add_decal('Right',t4,obj)
- add_decal('Front',t5,obj)
- add_decal('Back',t6,obj)
- end
- function make_bone(obj,targtorso)
- if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
- local bone = Instance.new("Part")
- bone.name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0.13,0.26,0)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780032'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(-0.13,0.26,0)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780156'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0,0.09,0.13)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780156'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0,0.09,0.13)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780195'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Head' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(0,0.66,0)
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = script
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- end
- end
- function break_limb(obj,rig,targtorso,targhum,dir)
- 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
- local confirm = Instance.new("ObjectValue")
- confirm.Name = 'Dismembered'
- confirm.Parent = obj
- local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
- if bsc then
- bsc:Destroy()
- end
- bleed2(obj,targhum,false,5,false)
- add_blood(obj)
- make_bone(obj,targtorso)
- local kb = 70
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = dir*kb+Vector3.new(0,kb,0)
- bv.Parent = obj
- game:GetService("Debris"):AddItem(bv,0.1)
- if rig == Enum.HumanoidRigType.R6 then
- local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
- if bsc then
- bsc:Destroy()
- end
- for i,v in pairs(targtorso:GetChildren()) do
- if v:IsA("Motor6D") then
- if obj.Name == 'Head' and v.Name == 'Neck' then
- v:Destroy()
- elseif obj.Name == 'Left Arm' and v.Name == 'Left Shouldver' then
- v:Destroy()
- elseif obj.Name == 'Right Arm' and v.Name == 'Right Shoulder' then
- v:Destroy()
- elseif obj.Name == 'Left Leg' and v.Name == 'Left Hip' then
- if obj.Parent:FindFirstChild("Right Leg") then
- targhum.WalkSpeed = targhum.WalkSpeed/2
- else
- targhum.WalkSpeed = 0
- end
- v:Destroy()
- elseif obj.Name == 'Right Leg' and v.Name == 'Right Hip' then
- if obj.Parent:FindFirstChild("Left Leg") then
- targhum.WalkSpeed = targhum.WalkSpeed/2
- else
- targhum.WalkSpeed = 0
- end
- v:Destroy()
- end
- end
- end
- elseif rig == Enum.HumanoidRigType.R15 then
- for i,v in pairs(obj:GetChildren()) do
- if v:IsA("Motor6D") then
- if (obj.Name == 'LeftUpperLeg' and obj.Parent:FindFirstChild("RightUpperLeg")) or (obj.Name == 'RightUpperLeg' and obj.Parent:FindFirstChild("LeftUpperLeg")) then
- targhum.WalkSpeed = targhum.WalkSpeed/2
- elseif obj.Name == 'RightUpperLeg' or obj.Name == 'LeftUpperLeg' then
- targhum.WalkSpeed = 0
- end
- v:Destroy()
- end
- end
- end
- local cb = Instance.new("Part")
- cb.Name = 'limb'
- cb.Transparency = 1
- cb.CanCollide = true
- cb.Anchored = false
- cb.CFrame = obj.CFrame
- cb.Size = obj.Size
- cb.Massless = true
- cb.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = cb
- weld.Part1 = obj
- weld.Parent = cb
- obj.Massless = true
- obj.Anchored = false
- cb.Parent = script
- end
- function bleed2(frick,targhum,can_hurt,t,splat)
- spawn(function()
- if not frick:FindFirstChild("bleeding from kry's c4") then else return end
- local tempbleedval = Instance.new("ObjectValue")
- tempbleedval.Name = "bleeding from kry's c4"
- tempbleedval.Parent = frick
- local bleeding = true
- local rig = targhum.RigType
- local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
- spawn(function()
- wait(t)
- bleeding = false
- tempbleedval:Destroy()
- end)
- while bleeding and frick and frick.Parent do
- if --[[(targhum and targhum.Parent and targhum.Health > 0) or]] (not frick or not frick.Parent or not targhum or not targhum.Parent) then
- break
- end
- local max_limbs = 0
- local current_limbs = 0
- local gone_limbs = 0
- local targchar = targhum.Parent
- if rig == Enum.HumanoidRigType.R6 then
- max_limbs = 5
- elseif rig == Enum.HumanoidRigType.R15 then
- max_limbs = 13
- end
- for i,v in pairs(targchar:GetChildren()) do
- local found = false
- for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
- if found and not v:FindFirstChild("Dismembered") then
- current_limbs = current_limbs + 1
- end
- end
- gone_limbs = (max_limbs-current_limbs)
- if targhum and can_hurt then
- if gone_limbs >= 1 then
- targhum:TakeDamage(0.5*gone_limbs)
- else
- targhum:TakeDamage(0.5)
- end
- end
- spawn(function()
- local thing = Instance.new('Part')
- thing.Parent = workspace
- thing.Size = Vector3.new(0.1,0.1,0.1)
- thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
- if splat then
- thing.Transparency = 0
- elseif not splat then
- thing.Transparency = 1
- end
- thing.Color = Color3.fromRGB(75, 0, 0)
- thing.Material = Enum.Material.Glass
- thing.Name = "blood_drop"
- thing.CanCollide =false
- thing:BreakJoints()
- local mesh = Instance.new('SpecialMesh')
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = thing
- --game:GetService("Debris"):AddItem(thing,5)
- local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
- att1.Parent = thing
- att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
- att2.Parent = thing
- att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
- if splat then
- local trail_drop = Instance.new("Trail")
- trail_drop.Parent = thing
- trail_drop.Attachment0 = att1
- trail_drop.Attachment1 = att2
- trail_drop.Color = ColorSequence.new(Color3.new(0.294118, 0, 0),Color3.new(0.294118, 0, 0))
- trail_drop.FaceCamera = true
- trail_drop.LightInfluence = 1
- trail_drop.Transparency = NumberSequence.new(0.1,1)
- trail_drop.Lifetime = 1
- trail_drop.MinLength = 0
- end
- local rawrxd = Instance.new('BodyForce')
- rawrxd.Parent = thing
- if splat then
- rawrxd.Force = frick.CFrame.upVector+Vector3.new(math.random(-5, 5)/10,3,math.random(-5, 5)/10)
- elseif not splat then
- rawrxd.Force = frick.CFrame.upVector*(math.random()*2)+Vector3.new(math.random(-5, 5)/10,1.5,0)
- end
- game:GetService("Debris"):AddItem(rawrxd,0.01)
- thing.Touched:connect(function(tou)
- 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
- local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
- local Point1 = pos-Vector3.new(0.01,0.01,0.01)
- local Point2 = pos+Vector3.new(0.01,0.01,0.01)
- local Region = Region3.new(Point1,Point2)
- for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
- if Part.Name == "blood" then
- tou = Part
- end
- end
- thing:Destroy()
- if tou.Name == "blood" then
- local reee = tou.CFrame
- if tou.Transparency > -0.2 then
- tou.Transparency = tou.Transparency - 0.1
- end
- if tou.Size.X < 5 then
- tou.Size = tou.Size+Vector3.new(0.4,0,0.4)
- tou.CFrame = reee
- elseif tou.Size.X < 7.5 then
- tou.Size = tou.Size+Vector3.new(0.3,0,0.3)
- tou.CFrame = reee
- elseif tou.Size.X < 10 then
- tou.Size = tou.Size+Vector3.new(0.2,0,0.2)
- tou.CFrame = reee
- end
- elseif tou.CanCollide == true then
- local bloodlol = Instance.new('Part')
- if gone_limbs >= 1 then
- bloodlol.Size = Vector3.new(1*gone_limbs,0.2,1*gone_limbs)
- else
- bloodlol.Size = Vector3.new(1,0.2,1)
- end
- bloodlol.Name = "blood"
- bloodlol.Anchored = true
- bloodlol.CanCollide = false
- bloodlol.Material = Enum.Material.Glass
- bloodlol.Color = Color3.fromRGB(75, 0, 0)
- local mesh = Instance.new('SpecialMesh')
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = bloodlol
- bloodlol.Parent = workspace
- bloodlol.CFrame = CFrame.new(pos)
- while bloodlol and bloodlol.Parent ~= nil do
- if bloodlol.Transparency < 1 then
- bloodlol.Transparency = bloodlol.Transparency + 0.05
- else
- bloodlol:Destroy()
- end
- wait(0.1)
- end
- end
- end
- end)
- end)
- wait(0.1)
- end
- tempbleedval:Destroy()
- end)
- end
- function gore_explode(obj,dir)
- local targchar,targhead,targtorso,targhum,killval
- pcall(function()
- targchar = obj.Parent
- end)
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- if v and v.Character and obj:IsDescendantOf(v.Character) then
- targchar = v.Character
- end
- end
- pcall(function()
- targhead = targchar:FindFirstChild("Head")
- end)
- pcall(function()
- targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
- end)
- pcall(function()
- targhum = targchar:FindFirstChildOfClass("Humanoid")
- end)
- pcall(function()
- killval = targhum:FindFirstChild("killer")
- end)
- if targchar and targhead and targtorso and targhum and not killval then
- targhum:TakeDamage(1/0)
- break_limb(targhead,targhum.RigType,targtorso,targhum,dir)
- if 0 > targhum.Health then
- local bleeding = Instance.new("Sound")
- bleeding.SoundId = 'rbxassetid://360007673'
- bleeding.Volume = 0.5
- bleeding.Parent = obj
- bleeding:Play()
- local fakechar,faketorso
- local tempkillval = Instance.new("ObjectValue",targhum)
- tempkillval.Name = "killer"
- tempkillval.Value = plr
- local kb = 75
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = dir*kb+Vector3.new(0,kb,0)
- bv.Parent = targtorso
- game:GetService("Debris"):AddItem(bv,0.1)
- pcall(function()
- local tempkillval = Instance.new("ObjectValue")
- tempkillval.Name = 'killer'
- tempkillval.Value = nil -- plr
- tempkillval.Parent = hum
- local ragval = Instance.new("ObjectValue")
- ragval.Name = 'Ragdolled'
- ragval.Parent = hum
- hum.AutoRotate = false
- hum.PlatformStand = true
- Ragdoll(targchar,true,false,true)
- end)
- bleed2(targtorso,targhum,true,5,true)
- local decap_bleed = Instance.new("Sound")
- decap_bleed.SoundId = 'rbxassetid://244502094'
- decap_bleed.Volume = 0.5
- decap_bleed.Parent = targtorso
- decap_bleed:Play()
- local decap_head = Instance.new("Sound")
- decap_head.SoundId = 'rbxassetid://1255040462' --222406108
- decap_head.Volume = 1
- decap_head.Parent = targtorso
- decap_head:Play()
- local att = Instance.new("Attachment")
- att.Parent = targtorso
- att.Position = Vector3.new(0,targtorso.Size.Y/2,0)
- local blood_emitter = Instance.new("ParticleEmitter")
- blood_emitter.Name = "Blood2"
- blood_emitter.Parent = att
- blood_emitter.Speed = NumberRange.new(5, 14)
- blood_emitter.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
- blood_emitter.LightEmission = 0.20000000298023
- blood_emitter.LightInfluence = 1
- blood_emitter.Texture = "http://www.roblox.com/asset/?id=134531274"
- blood_emitter.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
- blood_emitter.ZOffset = 0
- blood_emitter.Size = NumberSequence.new(0.12499988079071,0)
- blood_emitter.Acceleration = Vector3.new(0, -20, 0)
- blood_emitter.Lifetime = NumberRange.new(0.5, 1.5)
- blood_emitter.Rate = 100000
- blood_emitter.SpreadAngle = Vector2.new(90, 90)
- blood_emitter.VelocitySpread = 90
- blood_emitter.Enabled = true
- spawn(function()
- wait(5)
- blood_emitter.Enabled = false
- game:GetService("Debris"):AddItem(blood_emitter,2)
- end)
- end
- end
- end
- function explode(b)
- local gores = {3739335007,3929462189,3737268126,3739335394,206082273,4953187368,4953187704} -- 3739364168
- local exp = Instance.new("Part",script)
- exp.Size = Vector3.new()
- exp.Locked = true
- exp.Anchored = true
- exp.Transparency = 1
- exp.Position = b.Position
- b:Destroy()
- local size = 125
- local ex = Instance.new("Explosion",script)
- ex.Visible = true
- ex.Position = exp.Position
- ex.BlastRadius = ((size/2)-1)
- ex.BlastPressure = 1000000
- ex.DestroyJointRadiusPercent = 1
- ex.ExplosionType = Enum.ExplosionType.Craters
- spawn(function()
- ex_fx(ex,size)
- end)
- ex.Hit:connect(function(obj,dist)
- if ((size/2)-1) >= dist and obj ~= exp then else return end
- local targchar,targtorso,targhum
- pcall(function()
- targchar = obj.Parent
- end)
- pcall(function()
- targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("LowerTorso") or targchar:FindFirstChild("HumanoidRootPart")
- end)
- pcall(function()
- targhum = targchar:FindFirstChildOfClass("Humanoid")
- end)
- if targchar and targtorso and targhum then
- local gore_s = Instance.new("Sound")
- gore_s.SoundId = 'rbxassetid://' .. gores[math.random(1,#gores)]
- gore_s.Volume = 0.1
- gore_s.Parent = targtorso
- gore_s:Play()
- local dir = ((targtorso.Position-exp.Position)*Vector3.new(1,0,1)).Unit
- gore_explode(obj,dir)
- if math.random(1,5) == 1 then
- break_limb(obj,targhum.RigType,targtorso,targhum,dir)
- end
- else
- obj.Anchored = false
- end
- end)
- debris:AddItem(ex,5)
- local ex_s = Instance.new("Sound",exp)
- ex_s.SoundId = "rbxassetid://2540028294"
- ex_s.Volume = 10
- ex_s:Play()
- wait(0.5)
- --[[
- local twin = Instance.new("Sound",script)
- twin.SoundId = "rbxassetid://180746497"
- twin.Volume = 2
- twin:Play()
- ]]
- end
- function timer(bomb)
- local BillboardGui0 = Instance.new("BillboardGui")
- local TextButton1 = Instance.new("TextBox")
- BillboardGui0.Parent = bomb
- BillboardGui0.Size = UDim2.new(40, 40, 1, 1)
- BillboardGui0.Active = true
- BillboardGui0.StudsOffset = Vector3.new(0, 3, 0)
- TextButton1.Parent = BillboardGui0
- TextButton1.Size = UDim2.new(1, 0, 1, 0)
- TextButton1.BackgroundColor = BrickColor.new("Institutional white")
- TextButton1.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton1.BackgroundTransparency = 1
- TextButton1.Selectable = false
- TextButton1.Font = Enum.Font.SourceSans
- TextButton1.FontSize = Enum.FontSize.Size14
- TextButton1.Text = ""
- TextButton1.TextColor = BrickColor.new("Salmon")
- TextButton1.TextColor3 = Color3.new(1, 0.509804, 0.639216)
- TextButton1.TextScaled = true
- TextButton1.TextSize = 14
- TextButton1.TextStrokeTransparency = 0.5
- TextButton1.TextWrap = true
- TextButton1.TextWrapped = true
- TextButton1.TextYAlignment = Enum.TextYAlignment.Top
- local wt = 0.5
- local att = Instance.new("Attachment")
- att.Position = Vector3.new(-0.46, 0.15, 0.49)
- att.Parent = bomb
- local ParticleEmitter0 = Instance.new("ParticleEmitter")
- ParticleEmitter0.Parent = att
- ParticleEmitter0.Speed = NumberRange.new(0, 0)
- ParticleEmitter0.Color = ColorSequence.new(Color3.new(1, 0, 0.0156863),Color3.new(1, 0, 0.0156863))
- ParticleEmitter0.LightEmission = 1
- ParticleEmitter0.LightInfluence = 1
- ParticleEmitter0.ZOffset = 1
- ParticleEmitter0.Size = NumberSequence.new(0.3,0.3)
- ParticleEmitter0.Lifetime = NumberRange.new(0.1, 0.1)
- ParticleEmitter0.Rate = 25
- local s10_countdown
- spawn(function()
- repeat
- local _wt = wt*(countdown/max_time)
- ParticleEmitter0.Enabled = true
- wait(_wt)
- ParticleEmitter0.Enabled = false
- local beep = Instance.new("Sound",bomb)
- beep.SoundId = "rbxassetid://223016389"
- beep.Volume = 0.6
- --beep.PlaybackSpeed = 1+(0.3-(countdown/max_time)/3.3)
- beep:Play()
- wait(_wt)
- until (0 >= countdown) or (completed_modules >= total_modules) or mistake
- end)
- repeat
- countdown = countdown - 1
- TextButton1.Text = "Time left: " .. countdown
- if 10 >= countdown and not s10_countdown then
- s10_countdown = Instance.new("Sound",bomb)
- s10_countdown.SoundId = "rbxassetid://1476099718"
- s10_countdown.Volume = 4
- s10_countdown:Play()
- end
- wait(wt*2)
- until (0 >= countdown) or (completed_modules >= total_modules) or mistake
- if (completed_modules >= total_modules) then
- --bomb:Destroy()
- local bomb_defused = Instance.new("Sound",script)
- bomb_defused.SoundId = "rbxassetid://3690455164"
- bomb_defused.Volume = 2
- bomb_defused:Play()
- if s10_countdown then
- s10_countdown:Destroy()
- end
- --[[
- local ctwin = Instance.new("Sound",script)
- ctwin.SoundId = "rbxassetid://180746506"
- ctwin.Volume = 2
- ctwin:Play()
- ]]
- TextButton1.Text = "Defused"
- elseif mistake or (0 >= countdown) then
- local de_s = Instance.new("Sound",bomb)
- de_s.SoundId = "rbxassetid://4854660190"
- de_s.Volume = 7
- de_s:Play()
- repeat wait() until not de_s.IsPlaying
- explode(bomb)
- end
- end
- local module_list = {
- function(f)
- if not f['clicker'] then
- total_modules = total_modules + 1
- table.insert(modules,#modules+1,{id = 'clicker',finished = false,clicks = 100})
- else
- create_module()
- end
- end;
- function(f)
- if not f['hold'] then
- total_modules = total_modules + 1
- table.insert(modules,#modules+1,{id = 'hold',finished = false,time = 10})
- else
- create_module()
- end
- end;
- function(f)
- if not f['square'] then
- total_modules = total_modules + 1
- local combination = {}
- for i = 1,5 do
- local mrd = math.random(1,4)
- if mrd == 1 then
- combination[i] = 'red'
- elseif mrd == 2 then
- combination[i] = 'blue'
- elseif mrd == 3 then
- combination[i] = 'green'
- elseif mrd == 4 then
- combination[i] = 'yellow'
- end
- end
- table.insert(modules,#modules+1,{id = 'square',finished = false,combination = combination})
- else
- create_module()
- end
- end;
- function(f)
- if not f['dial'] then
- total_modules = total_modules + 1
- table.insert(modules,#modules+1,{id = 'dial',finished = false})
- else
- create_module()
- end
- end;
- function(f)
- if not f['wire'] then
- total_modules = total_modules + 1
- local color = ''
- local text = ''
- local mrd = math.random(1,3)
- if mrd == 1 then
- color = 'red'
- if math.random(1,2) == 1 then
- text = 'Cut the red color'
- else
- text = 'Cut blue'
- end
- elseif mrd == 2 then
- color = 'blue'
- if math.random(1,2) == 1 then
- text = 'Cut the blue color'
- else
- text = 'Cut green'
- end
- elseif mrd == 3 then
- color = 'green'
- if math.random(1,2) == 1 then
- text = 'Cut the green color'
- else
- text = 'Cut red'
- end
- end
- table.insert(modules,#modules+1,{id = 'wire',finished = false,color = color,text = text,clicked = {}})
- else
- create_module()
- end
- end;
- function(f)
- if not f['panel'] then
- total_modules = total_modules + 1
- local ct = {}
- for i = 1,8 do
- local activated = 0
- for i,v in pairs(ct) do
- if v then
- activated = activated + 1
- end
- end
- if 7 > activated then
- local bool = false
- if math.random(1,2) == 1 then
- bool = true
- end
- ct['d' .. i] = bool
- else
- break
- end
- end
- table.insert(modules,#modules+1,{id = 'panel',finished = false,clicked = ct})
- else
- create_module()
- end
- end;
- }
- function create_module()
- local f = {}
- for i,v in pairs(modules) do
- f[v.id] = true
- end
- module_list[math.random(1,#module_list)](f)
- end
- function get_time()
- local n = countdown
- local mins = 0
- local t = ''
- if n >= mins then
- mins = math.floor(n/60)
- n = n-mins*60;
- end
- if 0 >= mins then
- t = '00:'
- elseif 10 > mins then
- t = '0' .. mins .. ':'
- elseif mins >= 10 then
- t = mins .. ':'
- end
- if 0 >= n then
- t = t .. '00'
- elseif 10 > n then
- t = t .. '0' .. n
- elseif n >= 10 then
- t = t .. n
- end
- return t
- end
- function create_gui(p,t,bomb)
- local pgui = p:FindFirstChildOfClass("PlayerGui")
- local dgui = pgui:FindFirstChild("Defuse Gui")
- local close = true
- if pgui and t and bomb and not dgui then
- local module_screen,time_t
- local id = 1
- local module = modules[id]
- local lt = tick()
- spawn(function()
- while defuse_dist >= (bomb.Position-t.Position).Magnitude and (completed_modules < total_modules) and not mistake and bomb and countdown > 0 do
- if module_screen then
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- end
- if module.id == 'clicker' then
- local b = module_screen:FindFirstChild("TextButton")
- if b then
- if not module.finished then
- --b.Text = "CLICK (" .. module.clicks .. ")"
- elseif module.finished and b.Text ~= 'DONE' then
- b.Text = "DONE"
- return
- end
- end
- elseif module.id == 'hold' then
- local b = module_screen:FindFirstChild("TextButton")
- if b then
- if module.finished and b.Text ~= 'DONE' then
- b.Text = "DONE"
- return
- end
- end
- elseif module.id == 'panel' then
- for _,button in pairs(module_screen:GetChildren()) do
- if module.clicked[button.Name] then
- button.BackgroundColor3 = Color3.new(0,1,0)
- else
- button.BackgroundColor3 = Color3.new(1,0,0)
- end
- end
- elseif module.id == 'wire' then
- for _,button in pairs(module_screen:GetChildren()) do
- if module.clicked[button.Name] then
- button:Destroy()
- end
- end
- end
- end
- if time_t and tick()-lt >= 1 then
- lt = tick()
- time_t.Text = get_time()
- end
- wait(0.25)
- end
- close = false
- if dgui then
- dgui:Destroy()
- end
- end)
- local ScreenGui0 = Instance.new("ScreenGui")
- local Frame1 = Instance.new("Frame")
- local TextButton2 = Instance.new("TextButton")
- local TextButton3 = Instance.new("TextButton")
- local Frame4 = Instance.new("Frame")
- ScreenGui0.Name = 'Defuse Gui'
- ScreenGui0.Parent = pgui
- ScreenGui0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame1.Parent = ScreenGui0
- Frame1.Position = UDim2.new(0.255, 0, 0.146, 0)
- Frame1.Size = UDim2.new(0, 550, 0, 442)
- Frame1.BackgroundColor = BrickColor.new("Dirt brown")
- Frame1.BackgroundColor3 = Color3.new(0.223529, 0.223529, 0.223529)
- TextButton2.Name = "before"
- TextButton2.Parent = Frame1
- TextButton2.Position = UDim2.new(0, 0, 0.929870009, 0)
- TextButton2.Size = UDim2.new(0, 270, 0, 30)
- TextButton2.BackgroundColor = BrickColor.new("Black")
- TextButton2.BackgroundColor3 = Color3.new(0.211765, 0.211765, 0.211765)
- TextButton2.Font = Enum.Font.SourceSans
- TextButton2.FontSize = Enum.FontSize.Size14
- TextButton2.Text = "<"
- TextButton2.TextColor = BrickColor.new("Institutional white")
- TextButton2.TextColor3 = Color3.new(1, 1, 1)
- TextButton2.TextScaled = true
- TextButton2.TextSize = 14
- TextButton2.TextStrokeTransparency = 0
- TextButton2.TextWrap = true
- TextButton2.TextWrapped = true
- TextButton3.Name = "next"
- TextButton3.Parent = Frame1
- TextButton3.Position = UDim2.new(0.507467151, 0, 0.929870009, 0)
- TextButton3.Size = UDim2.new(0, 270, 0, 30)
- TextButton3.BackgroundColor = BrickColor.new("Black")
- TextButton3.BackgroundColor3 = Color3.new(0.211765, 0.211765, 0.211765)
- TextButton3.Font = Enum.Font.SourceSans
- TextButton3.FontSize = Enum.FontSize.Size14
- TextButton3.Text = ">"
- TextButton3.TextColor = BrickColor.new("Institutional white")
- TextButton3.TextColor3 = Color3.new(1, 1, 1)
- TextButton3.TextScaled = true
- TextButton3.TextSize = 14
- TextButton3.TextStrokeTransparency = 0
- TextButton3.TextWrap = true
- TextButton3.TextWrapped = true
- Frame4.Name = "module_screen"
- Frame4.Parent = Frame1
- Frame4.Position = UDim2.new(0.0109090907, 0, 0.0135746608, 0)
- Frame4.Size = UDim2.new(0, 537, 0, 398)
- Frame4.BackgroundColor = BrickColor.new("Maroon")
- Frame4.BackgroundColor3 = Color3.new(0.490196, 0, 0.00784314)
- dgui = ScreenGui0
- local main = dgui.Frame
- module_screen = main.module_screen
- local previous = main.before
- local after = main.next
- time_t = Instance.new("TextBox")
- time_t.Name = "time"
- time_t.Parent = main
- time_t.Position = UDim2.new(0, 0, -0.113122173, 0)
- time_t.Size = UDim2.new(0, 550, 0, 50)
- time_t.BackgroundColor = BrickColor.new("Black metallic")
- time_t.BackgroundColor3 = Color3.new(0.133333, 0.133333, 0.133333)
- time_t.Font = Enum.Font.SourceSans
- time_t.FontSize = Enum.FontSize.Size14
- time_t.TextColor = BrickColor.new("Institutional white")
- time_t.TextColor3 = Color3.new(1, 1, 1)
- time_t.TextScaled = true
- time_t.TextSize = 14
- time_t.TextStrokeTransparency = 0
- time_t.TextWrap = true
- time_t.TextWrapped = true
- local function load_module()
- if close or mistake then else dgui:Destroy(); return; end;
- module_screen:ClearAllChildren()
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- else
- module_screen.BackgroundColor3 = Color3.fromRGB(47,47,47)
- end
- if module.id == 'clicker' then
- local TextButton0 = Instance.new("TextButton")
- TextButton0.Parent = module_screen
- TextButton0.Position = UDim2.new(0.314711362, 0, 0.527638197, 0)
- TextButton0.Size = UDim2.new(0, 200, 0, 114)
- TextButton0.BackgroundColor = BrickColor.new("Silver flip/flop")
- TextButton0.BackgroundColor3 = Color3.new(0.541176, 0.541176, 0.541176)
- TextButton0.Font = Enum.Font.SourceSans
- TextButton0.FontSize = Enum.FontSize.Size14
- TextButton0.TextColor = BrickColor.new("Really black")
- TextButton0.TextColor3 = Color3.new(0, 0, 0)
- TextButton0.TextScaled = true
- TextButton0.TextSize = 14
- TextButton0.TextWrap = true
- TextButton0.TextWrapped = true
- if not module.finished then
- TextButton0.Text = "CLICK ALOT"
- else
- TextButton0.Text = "DONE"
- return
- end
- TextButton0.MouseButton1Click:Connect(function()
- if module.finished then
- TextButton0.Text = "DONE"
- return
- end
- module.clicks = module.clicks - 1
- if 0 >= module.clicks and not module.finished then
- module.finished = true
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://317553816'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local cm = 0
- for i,v in pairs(modules) do
- if v.finished then
- cm = cm + 1
- end
- end
- completed_modules = cm
- end
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- TextButton0.Text = "DONE"
- end
- end)
- elseif module.id == 'panel' then
- local TextButton0 = Instance.new("TextButton")
- local TextButton1 = Instance.new("TextButton")
- local TextButton2 = Instance.new("TextButton")
- local TextButton3 = Instance.new("TextButton")
- local TextButton4 = Instance.new("TextButton")
- local TextButton5 = Instance.new("TextButton")
- local TextButton6 = Instance.new("TextButton")
- local TextButton7 = Instance.new("TextButton")
- local TextButton8 = Instance.new("TextButton")
- TextButton0.Name = "d1"
- TextButton0.Parent = module_screen
- TextButton0.Position = UDim2.new(0.132216007, 0, 0.113065332, 0)
- TextButton0.Size = UDim2.new(0, 80, 0, 80)
- TextButton0.BackgroundColor = BrickColor.new("Institutional white")
- TextButton0.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton0.BackgroundTransparency = 0.20000000298023
- TextButton0.Font = Enum.Font.SourceSans
- TextButton0.FontSize = Enum.FontSize.Size14
- TextButton0.Text = ""
- TextButton0.TextColor = BrickColor.new("Really black")
- TextButton0.TextColor3 = Color3.new(0, 0, 0)
- TextButton0.TextSize = 14
- TextButton1.Name = "d2"
- TextButton1.Parent = module_screen
- TextButton1.Position = UDim2.new(0.422718793, 0, 0.394472361, 0)
- TextButton1.Size = UDim2.new(0, 80, 0, 80)
- TextButton1.BackgroundColor = BrickColor.new("Institutional white")
- TextButton1.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton1.BackgroundTransparency = 0.20000000298023
- TextButton1.Font = Enum.Font.SourceSans
- TextButton1.FontSize = Enum.FontSize.Size14
- TextButton1.Text = ""
- TextButton1.TextColor = BrickColor.new("Really black")
- TextButton1.TextColor3 = Color3.new(0, 0, 0)
- TextButton1.TextSize = 14
- TextButton2.Name = "d3"
- TextButton2.Parent = module_screen
- TextButton2.Position = UDim2.new(0.71322155, 0, 0.115577862, 0)
- TextButton2.Size = UDim2.new(0, 80, 0, 80)
- TextButton2.BackgroundColor = BrickColor.new("Institutional white")
- TextButton2.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton2.BackgroundTransparency = 0.20000000298023
- TextButton2.Font = Enum.Font.SourceSans
- TextButton2.FontSize = Enum.FontSize.Size14
- TextButton2.Text = ""
- TextButton2.TextColor = BrickColor.new("Really black")
- TextButton2.TextColor3 = Color3.new(0, 0, 0)
- TextButton2.TextSize = 14
- TextButton3.Name = "d4"
- TextButton3.Parent = module_screen
- TextButton3.Position = UDim2.new(0.71322155, 0, 0.678391933, 0)
- TextButton3.Size = UDim2.new(0, 80, 0, 80)
- TextButton3.BackgroundColor = BrickColor.new("Institutional white")
- TextButton3.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton3.BackgroundTransparency = 0.20000000298023
- TextButton3.Font = Enum.Font.SourceSans
- TextButton3.FontSize = Enum.FontSize.Size14
- TextButton3.Text = ""
- TextButton3.TextColor = BrickColor.new("Really black")
- TextButton3.TextColor3 = Color3.new(0, 0, 0)
- TextButton3.TextSize = 14
- TextButton4.Name = "d5"
- TextButton4.Parent = module_screen
- TextButton4.Position = UDim2.new(0.132215962, 0, 0.678391933, 0)
- TextButton4.Size = UDim2.new(0, 80, 0, 80)
- TextButton4.BackgroundColor = BrickColor.new("Institutional white")
- TextButton4.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton4.BackgroundTransparency = 0.20000000298023
- TextButton4.Font = Enum.Font.SourceSans
- TextButton4.FontSize = Enum.FontSize.Size14
- TextButton4.Text = ""
- TextButton4.TextColor = BrickColor.new("Really black")
- TextButton4.TextColor3 = Color3.new(0, 0, 0)
- TextButton4.TextSize = 14
- TextButton5.Name = "d6"
- TextButton5.Parent = module_screen
- TextButton5.Position = UDim2.new(0.422718793, 0, 0.77638191, 0)
- TextButton5.Size = UDim2.new(0, 80, 0, 80)
- TextButton5.BackgroundColor = BrickColor.new("Institutional white")
- TextButton5.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton5.BackgroundTransparency = 0.20000000298023
- TextButton5.Font = Enum.Font.SourceSans
- TextButton5.FontSize = Enum.FontSize.Size14
- TextButton5.Text = ""
- TextButton5.TextColor = BrickColor.new("Really black")
- TextButton5.TextColor3 = Color3.new(0, 0, 0)
- TextButton5.TextSize = 14
- TextButton6.Name = "d7"
- TextButton6.Parent = module_screen
- TextButton6.Position = UDim2.new(0.422718793, 0, 0.0226130337, 0)
- TextButton6.Size = UDim2.new(0, 80, 0, 80)
- TextButton6.BackgroundColor = BrickColor.new("Institutional white")
- TextButton6.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton6.BackgroundTransparency = 0.20000000298023
- TextButton6.Font = Enum.Font.SourceSans
- TextButton6.FontSize = Enum.FontSize.Size14
- TextButton6.Text = ""
- TextButton6.TextColor = BrickColor.new("Really black")
- TextButton6.TextColor3 = Color3.new(0, 0, 0)
- TextButton6.TextSize = 14
- TextButton7.Name = "d8"
- TextButton7.Parent = module_screen
- TextButton7.Position = UDim2.new(0.789571643, 0, 0.394472331, 0)
- TextButton7.Size = UDim2.new(0, 80, 0, 80)
- TextButton7.BackgroundColor = BrickColor.new("Institutional white")
- TextButton7.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton7.BackgroundTransparency = 0.20000000298023
- TextButton7.Font = Enum.Font.SourceSans
- TextButton7.FontSize = Enum.FontSize.Size14
- TextButton7.Text = ""
- TextButton7.TextColor = BrickColor.new("Really black")
- TextButton7.TextColor3 = Color3.new(0, 0, 0)
- TextButton7.TextSize = 14
- TextButton8.Name = "d9"
- TextButton8.Parent = module_screen
- TextButton8.Position = UDim2.new(0.0651768446, 0, 0.394472331, 0)
- TextButton8.Size = UDim2.new(0, 80, 0, 80)
- TextButton8.BackgroundColor = BrickColor.new("Institutional white")
- TextButton8.BackgroundColor3 = Color3.new(1, 1, 1)
- TextButton8.BackgroundTransparency = 0.20000000298023
- TextButton8.Font = Enum.Font.SourceSans
- TextButton8.FontSize = Enum.FontSize.Size14
- TextButton8.Text = ""
- TextButton8.TextColor = BrickColor.new("Really black")
- TextButton8.TextColor3 = Color3.new(0, 0, 0)
- TextButton8.TextSize = 14
- for _,button in pairs(module_screen:GetChildren()) do
- if module.clicked[button.Name] then
- button.BackgroundColor3 = Color3.new(0,1,0)
- else
- button.BackgroundColor3 = Color3.new(1,0,0)
- end
- button.MouseButton1Click:Connect(function()
- if module.finished then
- return
- end
- if module.clicked[button.Name] then
- module.clicked[button.Name] = false
- button.BackgroundColor3 = Color3.new(1,0,0)
- else
- module.clicked[button.Name] = true
- button.BackgroundColor3 = Color3.new(0,1,0)
- end
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://5289642056'
- click_s.PlaybackSpeed = math.random(100,110)/100
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local clicked = 0
- for i,v in pairs(module.clicked) do
- if i and v then
- clicked = clicked + 1
- end
- end
- if clicked >= #module_screen:GetChildren() and not module.finished then
- module.finished = true
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://317553816'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local cm = 0
- for i,v in pairs(modules) do
- if v.finished then
- cm = cm + 1
- end
- end
- completed_modules = cm
- end
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- end
- end)
- end
- elseif module.id == 'square' then
- local TextButton0 = Instance.new("TextButton")
- local TextButton1 = Instance.new("TextButton")
- local TextButton2 = Instance.new("TextButton")
- local TextLabel3 = Instance.new("TextBox")
- local TextButton4 = Instance.new("TextButton")
- TextButton0.Name = "green"
- TextButton0.Parent = module_screen
- TextButton0.Position = UDim2.new(0.305400372, 0, 0.55276376, 0)
- TextButton0.Size = UDim2.new(0, 100, 0, 100)
- TextButton0.BackgroundColor = BrickColor.new("Lime green")
- TextButton0.BackgroundColor3 = Color3.new(0, 1, 0)
- TextButton0.BackgroundTransparency = 0.7
- TextButton0.Font = Enum.Font.SourceSans
- TextButton0.FontSize = Enum.FontSize.Size14
- TextButton0.Text = ""
- TextButton0.TextColor = BrickColor.new("Really black")
- TextButton0.TextColor3 = Color3.new(0, 0, 0)
- TextButton0.TextSize = 14
- TextButton1.Name = "red"
- TextButton1.Parent = module_screen
- TextButton1.Position = UDim2.new(0.305400372, 0, 0.27638185, 0)
- TextButton1.Size = UDim2.new(0, 100, 0, 100)
- TextButton1.BackgroundColor = BrickColor.new("Really red")
- TextButton1.BackgroundColor3 = Color3.new(1, 0, 0)
- TextButton1.BackgroundTransparency = 0.7
- TextButton1.Font = Enum.Font.SourceSans
- TextButton1.FontSize = Enum.FontSize.Size14
- TextButton1.Text = ""
- TextButton1.TextColor = BrickColor.new("Really black")
- TextButton1.TextColor3 = Color3.new(0, 0, 0)
- TextButton1.TextSize = 14
- TextButton2.Name = "yellow"
- TextButton2.Parent = module_screen
- TextButton2.Position = UDim2.new(0.508379877, 0, 0.55276376, 0)
- TextButton2.Size = UDim2.new(0, 100, 0, 100)
- TextButton2.BackgroundColor = BrickColor.new("New Yeller")
- TextButton2.BackgroundColor3 = Color3.new(1, 1, 0)
- TextButton2.BackgroundTransparency = 0.7
- TextButton2.Font = Enum.Font.SourceSans
- TextButton2.FontSize = Enum.FontSize.Size14
- TextButton2.Text = ""
- TextButton2.TextColor = BrickColor.new("Really black")
- TextButton2.TextColor3 = Color3.new(0, 0, 0)
- TextButton2.TextSize = 14
- TextLabel3.Name = "title"
- TextLabel3.Parent = module_screen
- TextLabel3.Size = UDim2.new(0, 537, 0, 100)
- TextLabel3.BackgroundColor = BrickColor.new("Institutional white")
- TextLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel3.BackgroundTransparency = 1
- TextLabel3.Font = Enum.Font.SourceSans
- TextLabel3.FontSize = Enum.FontSize.Size14
- wait()
- TextLabel3.Text = "Hit the colors in the right order"
- TextLabel3.TextColor = BrickColor.new("Institutional white")
- TextLabel3.TextColor3 = Color3.new(1, 1, 1)
- TextLabel3.TextScaled = true
- TextLabel3.TextSize = 14
- TextLabel3.TextStrokeTransparency = 0
- TextLabel3.TextWrap = true
- TextLabel3.TextWrapped = true
- TextButton4.Name = "blue"
- TextButton4.Parent = module_screen
- TextButton4.Position = UDim2.new(0.508379877, 0, 0.27638185, 0)
- TextButton4.Size = UDim2.new(0, 100, 0, 100)
- TextButton4.BackgroundColor = BrickColor.new("Really blue")
- TextButton4.BackgroundColor3 = Color3.new(0, 0, 1)
- TextButton4.BackgroundTransparency = 0.7
- TextButton4.Font = Enum.Font.SourceSans
- TextButton4.FontSize = Enum.FontSize.Size14
- TextButton4.Text = ""
- TextButton4.TextColor = BrickColor.new("Really black")
- TextButton4.TextColor3 = Color3.new(0, 0, 0)
- TextButton4.TextSize = 14
- local order = {}
- local pressed = 0
- local can_press = false
- if module.finished then
- return
- end
- for _,button in pairs(module_screen:GetChildren()) do
- if button:IsA("TextButton") then
- button.MouseButton1Click:Connect(function()
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://1283290053'
- click_s.PlaybackSpeed = math.random(100,110)/100
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- if module.finished or not can_press then
- return
- end
- if order[pressed+1] == button.Name then
- pressed = pressed + 1
- else
- mistake = true
- local mistake_s = Instance.new("Sound")
- mistake_s.SoundId = 'rbxassetid://1000294392'
- mistake_s.Volume = 1
- mistake_s.Parent = dgui
- mistake_s:Play()
- end
- button.BackgroundTransparency = 0
- wait(0.5)
- button.BackgroundTransparency = 0.7
- end)
- end
- end
- for i = 1,5 do
- can_press = true
- wait(1)
- pressed = 0
- if dgui and module.id == 'square' then else return end
- table.insert(order,#order+1,module.combination[i])
- for i2 = 1,i do
- if dgui and module.id == 'square' then else return end
- module_screen[module.combination[i2]].BackgroundTransparency = 0
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://300473653'
- click_s.PlaybackSpeed = math.random(100,110)/100
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- wait(0.5)
- if dgui and module.id == 'square' then else return end
- module_screen[module.combination[i2]].BackgroundTransparency = 0.7
- wait(0.1)
- end
- can_press = true
- repeat wait(0.1) until pressed >= i or module.id ~= 'square'
- if dgui and module.id == 'square' then else return end
- end
- if not module.finished and not mistake and dgui and module.id == 'square' then
- module.finished = true
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://317553816'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local cm = 0
- for i,v in pairs(modules) do
- if v.finished then
- cm = cm + 1
- end
- end
- completed_modules = cm
- end
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- end
- elseif module.id == 'dial' then
- local Frame0 = Instance.new("Frame")
- local Frame1 = Instance.new("Frame")
- local Frame2 = Instance.new("Frame")
- local Frame3 = Instance.new("Frame")
- local Frame4 = Instance.new("Frame")
- local Frame5 = Instance.new("Frame")
- local Frame6 = Instance.new("Frame")
- local TextButton7 = Instance.new("TextButton")
- local TextButton8 = Instance.new("TextButton")
- local TextButton9 = Instance.new("TextButton")
- local TextButton10 = Instance.new("TextButton")
- local TextLabel11 = Instance.new("TextBox")
- Frame0.Name = "1"
- Frame0.Parent = module_screen
- Frame0.Position = UDim2.new(0.890799582, 0, 0.884346724, 0)
- Frame0.Size = UDim2.new(0, 37, 0, 16)
- Frame0.BackgroundColor = BrickColor.new("Black")
- Frame0.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- Frame0.ZIndex = 2
- Frame1.Name = "2"
- Frame1.Parent = module_screen
- Frame1.Position = UDim2.new(0.890799582, 0, 0.818944752, 0)
- Frame1.Size = UDim2.new(0, 37, 0, 16)
- Frame1.BackgroundColor = BrickColor.new("Black")
- Frame1.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- Frame1.ZIndex = 2
- Frame2.Name = "3"
- Frame2.Parent = module_screen
- Frame2.Position = UDim2.new(0.890799582, 0, 0.756984949, 0)
- Frame2.Size = UDim2.new(0, 37, 0, 16)
- Frame2.BackgroundColor = BrickColor.new("Black")
- Frame2.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- Frame2.ZIndex = 2
- Frame3.Name = "4"
- Frame3.Parent = module_screen
- Frame3.Position = UDim2.new(0.890799582, 0, 0.691582918, 0)
- Frame3.Size = UDim2.new(0, 37, 0, 16)
- Frame3.BackgroundColor = BrickColor.new("Black")
- Frame3.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- Frame3.ZIndex = 2
- Frame4.Name = "5"
- Frame4.Parent = module_screen
- Frame4.Position = UDim2.new(0.890799582, 0, 0.622738719, 0)
- Frame4.Size = UDim2.new(0, 37, 0, 16)
- Frame4.BackgroundColor = BrickColor.new("Black")
- Frame4.BackgroundColor3 = Color3.new(0.196078, 0.196078, 0.196078)
- Frame4.ZIndex = 2
- Frame5.Parent = module_screen
- Frame5.Position = UDim2.new(0.88081938, 0, 0.605527639, 0)
- Frame5.Size = UDim2.new(0, 49, 0, 137)
- Frame5.BackgroundColor = BrickColor.new("Really black")
- Frame5.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame6.Parent = module_screen
- Frame6.Position = UDim2.new(0.126629427, 0, 0.0603015088, 0)
- Frame6.Size = UDim2.new(0, 387, 0, 217)
- Frame6.BackgroundColor = BrickColor.new("Really black")
- Frame6.BackgroundColor3 = Color3.new(0, 0, 0)
- TextButton7.Name = "n1"
- TextButton7.Parent = module_screen
- TextButton7.Position = UDim2.new(0.0465549342, 0, 0.660804033, 0)
- TextButton7.Size = UDim2.new(0, 100, 0, 100)
- TextButton7.BackgroundColor = BrickColor.new("Earth green")
- TextButton7.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
- TextButton7.Font = Enum.Font.Merriweather
- TextButton7.FontSize = Enum.FontSize.Size14
- TextButton7.Text = "I"
- TextButton7.TextColor = BrickColor.new("Institutional white")
- TextButton7.TextColor3 = Color3.new(1, 1, 1)
- TextButton7.TextScaled = true
- TextButton7.TextSize = 14
- TextButton7.TextStrokeTransparency = 0
- TextButton7.TextWrap = true
- TextButton7.TextWrapped = true
- TextButton8.Name = "n2"
- TextButton8.Parent = module_screen
- TextButton8.Position = UDim2.new(0.249534458, 0, 0.660804033, 0)
- TextButton8.Size = UDim2.new(0, 100, 0, 100)
- TextButton8.BackgroundColor = BrickColor.new("Earth green")
- TextButton8.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
- TextButton8.Font = Enum.Font.Merriweather
- TextButton8.FontSize = Enum.FontSize.Size14
- TextButton8.Text = "II"
- TextButton8.TextColor = BrickColor.new("Institutional white")
- TextButton8.TextColor3 = Color3.new(1, 1, 1)
- TextButton8.TextScaled = true
- TextButton8.TextSize = 14
- TextButton8.TextStrokeTransparency = 0
- TextButton8.TextWrap = true
- TextButton8.TextWrapped = true
- TextButton9.Name = "n3"
- TextButton9.Parent = module_screen
- TextButton9.Position = UDim2.new(0.452513993, 0, 0.660804033, 0)
- TextButton9.Size = UDim2.new(0, 100, 0, 100)
- TextButton9.BackgroundColor = BrickColor.new("Earth green")
- TextButton9.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
- TextButton9.Font = Enum.Font.Merriweather
- TextButton9.FontSize = Enum.FontSize.Size14
- TextButton9.Text = "III"
- TextButton9.TextColor = BrickColor.new("Institutional white")
- TextButton9.TextColor3 = Color3.new(1, 1, 1)
- TextButton9.TextScaled = true
- TextButton9.TextSize = 14
- TextButton9.TextStrokeTransparency = 0
- TextButton9.TextWrap = true
- TextButton9.TextWrapped = true
- TextButton10.Name = "n4"
- TextButton10.Parent = module_screen
- TextButton10.Position = UDim2.new(0.661080122, 0, 0.660804033, 0)
- TextButton10.Size = UDim2.new(0, 100, 0, 100)
- TextButton10.BackgroundColor = BrickColor.new("Earth green")
- TextButton10.BackgroundColor3 = Color3.new(0.227451, 0.215686, 0.117647)
- TextButton10.Font = Enum.Font.Merriweather
- TextButton10.FontSize = Enum.FontSize.Size14
- TextButton10.Text = "IIII"
- TextButton10.TextColor = BrickColor.new("Institutional white")
- TextButton10.TextColor3 = Color3.new(1, 1, 1)
- TextButton10.TextScaled = true
- TextButton10.TextSize = 14
- TextButton10.TextStrokeTransparency = 0
- TextButton10.TextWrap = true
- TextButton10.TextWrapped = true
- TextLabel11.Name = "result"
- TextLabel11.Parent = module_screen
- TextLabel11.Position = UDim2.new(0.150999993, 0, 0.0930000022, 0)
- TextLabel11.Size = UDim2.new(0, 361, 0, 187)
- TextLabel11.BackgroundColor = BrickColor.new("Dirt brown")
- TextLabel11.BackgroundColor3 = Color3.new(0.262745, 0.262745, 0.262745)
- TextLabel11.Font = Enum.Font.Merriweather
- TextLabel11.FontSize = Enum.FontSize.Size14
- wait()
- TextLabel11.Text = "DONE"
- TextLabel11.TextColor = BrickColor.new("Institutional white")
- TextLabel11.TextColor3 = Color3.new(1, 1, 1)
- TextLabel11.TextScaled = true
- TextLabel11.TextSize = 14
- TextLabel11.TextStrokeTransparency = 0
- TextLabel11.TextWrap = true
- TextLabel11.TextWrapped = true
- local to_press = 0
- local pressed = 0
- local passed = 0
- local can_press = true
- if module.finished and dgui and module.id == 'dial' then
- for i = 1,5 do
- module_screen[tostring(i)].BackgroundColor3 = Color3.new(0,1,0)
- end
- return
- end
- for _,button in pairs(module_screen:GetChildren()) do
- if button:IsA("TextButton") then
- button.MouseButton1Click:Connect(function()
- if module.finished or not can_press or module.id ~= 'dial' then
- return
- end
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://4086020670'
- --click_s.PlaybackSpeed = math.random(100,110)/100
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- pressed = tonumber(string.sub(button.Name,2,2))
- if pressed ~= to_press then
- mistake = true
- local mistake_s = Instance.new("Sound")
- mistake_s.SoundId = 'rbxassetid://1000294392'
- mistake_s.Volume = 1
- mistake_s.Parent = dgui
- mistake_s:Play()
- end
- end)
- end
- end
- for i = 1,5 do
- for i = 1,3 do
- if dgui and module.id == 'dial' then else return end
- pressed = 0
- to_press = math.random(1,4)
- module_screen.result.Text = string.rep('I',to_press)
- repeat wait(0.1) until pressed > 0
- if dgui and module.id == 'dial' then else return end
- end
- passed = passed + 1
- if dgui and module.id == 'dial' then else return end
- module_screen[tostring(passed)].BackgroundColor3 = Color3.new(0,1,0)
- end
- if not module.finished and not mistake and dgui and module.id == 'dial' then
- module.finished = true
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://317553816'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local cm = 0
- for i,v in pairs(modules) do
- if v.finished then
- cm = cm + 1
- end
- end
- completed_modules = cm
- end
- if module.finished then
- module_screen.result.Text = 'DONE'
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- end
- elseif module.id == 'wire' then
- local Frame0 = Instance.new("Frame")
- local Frame1 = Instance.new("Frame")
- local Frame2 = Instance.new("Frame")
- local Frame3 = Instance.new("Frame")
- local Frame4 = Instance.new("Frame")
- local Frame5 = Instance.new("Frame")
- local TextButton6 = Instance.new("TextButton")
- local TextButton7 = Instance.new("TextButton")
- local TextLabel8 = Instance.new("TextBox")
- local TextButton9 = Instance.new("TextButton")
- Frame0.Parent = module_screen
- Frame0.Position = UDim2.new(0.115456238, 0, 0.138190955, 0)
- Frame0.Size = UDim2.new(0, 35, 0, 35)
- Frame0.BackgroundColor = BrickColor.new("Black")
- Frame0.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
- Frame0.ZIndex = 2
- Frame1.Parent = module_screen
- Frame1.Position = UDim2.new(0.11359404, 0, 0.457286447, 0)
- Frame1.Size = UDim2.new(0, 35, 0, 35)
- Frame1.BackgroundColor = BrickColor.new("Black")
- Frame1.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
- Frame1.ZIndex = 2
- Frame2.Parent = module_screen
- Frame2.Position = UDim2.new(0.115456238, 0, 0.771356761, 0)
- Frame2.Size = UDim2.new(0, 35, 0, 35)
- Frame2.BackgroundColor = BrickColor.new("Black")
- Frame2.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
- Frame2.ZIndex = 2
- Frame3.Parent = module_screen
- Frame3.Position = UDim2.new(0.821229041, 0, 0.138190955, 0)
- Frame3.Size = UDim2.new(0, 35, 0, 35)
- Frame3.BackgroundColor = BrickColor.new("Black")
- Frame3.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
- Frame3.ZIndex = 2
- Frame4.Parent = module_screen
- Frame4.Position = UDim2.new(0.821229041, 0, 0.771356761, 0)
- Frame4.Size = UDim2.new(0, 35, 0, 35)
- Frame4.BackgroundColor = BrickColor.new("Black")
- Frame4.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
- Frame4.ZIndex = 2
- Frame5.Parent = module_screen
- Frame5.Position = UDim2.new(0.819366872, 0, 0.457286447, 0)
- Frame5.Size = UDim2.new(0, 35, 0, 35)
- Frame5.BackgroundColor = BrickColor.new("Black")
- Frame5.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
- Frame5.ZIndex = 2
- TextButton6.Name = "blue"
- TextButton6.Parent = module_screen
- TextButton6.Position = UDim2.new(0.137802601, 0, 0.48241201, 0)
- TextButton6.Size = UDim2.new(0, 387, 0, 15)
- TextButton6.BackgroundColor = BrickColor.new("Really blue")
- TextButton6.BackgroundColor3 = Color3.new(0, 0, 1)
- TextButton6.BorderColor = BrickColor.new("Really black")
- TextButton6.BorderColor3 = Color3.new(0, 0, 0)
- TextButton6.BorderSizePixel = 2
- TextButton6.Font = Enum.Font.SourceSans
- TextButton6.FontSize = Enum.FontSize.Size14
- TextButton6.Text = "GREEN"
- TextButton6.TextColor = BrickColor.new("Institutional white")
- TextButton6.TextColor3 = Color3.new(1, 1, 1)
- TextButton6.TextScaled = true
- TextButton6.TextSize = 14
- TextButton6.TextStrokeTransparency = 0
- TextButton6.TextWrap = true
- TextButton6.TextWrapped = true
- TextButton7.Name = "green"
- TextButton7.Parent = module_screen
- TextButton7.Position = UDim2.new(0.139664799, 0, 0.796482384, 0)
- TextButton7.Size = UDim2.new(0, 387, 0, 15)
- TextButton7.BackgroundColor = BrickColor.new("Lime green")
- TextButton7.BackgroundColor3 = Color3.new(0, 1, 0)
- TextButton7.BorderColor = BrickColor.new("Really black")
- TextButton7.BorderColor3 = Color3.new(0, 0, 0)
- TextButton7.BorderSizePixel = 2
- TextButton7.Font = Enum.Font.SourceSans
- TextButton7.FontSize = Enum.FontSize.Size14
- TextButton7.Text = "RED"
- TextButton7.TextColor = BrickColor.new("Institutional white")
- TextButton7.TextColor3 = Color3.new(1, 1, 1)
- TextButton7.TextScaled = true
- TextButton7.TextSize = 14
- TextButton7.TextStrokeTransparency = 0
- TextButton7.TextWrap = true
- TextButton7.TextWrapped = true
- TextLabel8.Name = "title"
- TextLabel8.Parent = module_screen
- TextLabel8.Position = UDim2.new(0.00186219742, 0, 0, 0)
- TextLabel8.Size = UDim2.new(0, 536, 0, 55)
- TextLabel8.BackgroundColor = BrickColor.new("Institutional white")
- TextLabel8.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel8.BackgroundTransparency = 1
- TextLabel8.Font = Enum.Font.SourceSans
- TextLabel8.FontSize = Enum.FontSize.Size14
- TextLabel8.TextColor = BrickColor.new("Institutional white")
- TextLabel8.TextColor3 = Color3.new(1, 1, 1)
- TextLabel8.TextScaled = true
- TextLabel8.TextSize = 14
- TextLabel8.TextStrokeTransparency = 0
- TextLabel8.TextWrap = true
- TextLabel8.TextWrapped = true
- TextButton9.Name = "red"
- TextButton9.Parent = module_screen
- TextButton9.Position = UDim2.new(0.143389195, 0, 0.163316578, 0)
- TextButton9.Size = UDim2.new(0, 387, 0, 15)
- TextButton9.BackgroundColor = BrickColor.new("Really red")
- TextButton9.BackgroundColor3 = Color3.new(1, 0, 0)
- TextButton9.BorderColor = BrickColor.new("Really black")
- TextButton9.BorderColor3 = Color3.new(0, 0, 0)
- TextButton9.BorderSizePixel = 2
- TextButton9.Font = Enum.Font.SourceSans
- TextButton9.FontSize = Enum.FontSize.Size14
- TextButton9.Text = "BLUE"
- TextButton9.TextColor = BrickColor.new("Institutional white")
- TextButton9.TextColor3 = Color3.new(1, 1, 1)
- TextButton9.TextScaled = true
- TextButton9.TextSize = 14
- TextButton9.TextStrokeTransparency = 0
- TextButton9.TextWrap = true
- TextButton9.TextWrapped = true
- pcall(function()
- wait()
- module_screen.title.Text = string.upper(module.text)
- end)
- for _,button in pairs(module_screen:GetChildren()) do
- if button:IsA("TextButton") then
- if module.clicked[button.Name] then
- button:Destroy()
- end
- button.MouseButton1Click:Connect(function()
- if module.finished then
- return
- end
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://5124453445'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- module.clicked[button.Name] = true
- button:Destroy()
- if not module.finished then
- if module.color == button.Name then
- module.finished = true
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://317553816'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local cm = 0
- for i,v in pairs(modules) do
- if v.finished then
- cm = cm + 1
- end
- end
- completed_modules = cm
- else
- mistake = true
- local mistake_s = Instance.new("Sound")
- mistake_s.SoundId = 'rbxassetid://1000294392'
- mistake_s.Volume = 1
- mistake_s.Parent = dgui
- mistake_s:Play()
- end
- end
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- end
- end)
- end
- end
- elseif module.id == 'hold' then
- local TextButton0 = Instance.new("TextButton")
- TextButton0.Parent = module_screen
- TextButton0.Position = UDim2.new(0.314711362, 0, 0.527638197, 0)
- TextButton0.Size = UDim2.new(0, 200, 0, 114)
- TextButton0.BackgroundColor = BrickColor.new("Silver flip/flop")
- TextButton0.BackgroundColor3 = Color3.new(0.541176, 0.541176, 0.541176)
- TextButton0.Font = Enum.Font.SourceSans
- TextButton0.FontSize = Enum.FontSize.Size14
- TextButton0.TextColor = BrickColor.new("Really black")
- TextButton0.TextColor3 = Color3.new(0, 0, 0)
- TextButton0.TextScaled = true
- TextButton0.TextSize = 14
- TextButton0.TextWrap = true
- TextButton0.TextWrapped = true
- if not module.finished then
- TextButton0.Text = "HOLD"
- else
- TextButton0.Text = "DONE"
- return
- end
- local hid = 0
- TextButton0.MouseButton1Down:Connect(function()
- hid = hid + 1
- local cid = hid
- if not module.finished then
- TextButton0.Text = "HOLD"
- else
- --TextButton0.Text = "DONE"
- return
- end
- local hold_s = Instance.new("Sound")
- hold_s.SoundId = 'rbxassetid://133116870'
- hold_s.PlaybackSpeed = 0.1
- hold_s.Volume = 1
- hold_s.Looped = true
- hold_s.Parent = dgui
- hold_s:Play()
- for i = module.time,0,-1 do
- if hid == cid then else break end
- if dgui and module.id == 'hold' then else return end
- --TextButton0.Text = "HOLD"
- game:GetService("TweenService"):Create(hold_s,TweenInfo.new(1),{PlaybackSpeed = hold_s.PlaybackSpeed+0.1}):Play()
- if 0 >= i and not module.finished then
- module.finished = true
- local click_s = Instance.new("Sound")
- click_s.SoundId = 'rbxassetid://317553816'
- click_s.Volume = 1
- click_s.Parent = dgui
- click_s:Play()
- local cm = 0
- for i,v in pairs(modules) do
- if v.finished then
- cm = cm + 1
- end
- end
- completed_modules = cm
- end
- wait(1)
- end
- hold_s:Destroy()
- if dgui and module.id == 'hold' then else return end
- if module.finished then
- module_screen.BackgroundColor3 = Color3.new(0,1,0)
- TextButton0.Text = "DONE"
- else
- mistake = true
- local mistake_s = Instance.new("Sound")
- mistake_s.SoundId = 'rbxassetid://1000294392'
- mistake_s.Volume = 1
- mistake_s.Parent = dgui
- mistake_s:Play()
- --TextButton0.Text = "HOLD"
- end
- end)
- TextButton0.MouseButton1Up:Connect(function()
- hid = hid + 1
- end)
- end
- end
- spawn(function()
- load_module()
- end)
- previous.MouseButton1Click:Connect(function()
- id = id - 1
- if 1 > id then
- id = #modules
- end
- module = modules[id]
- spawn(function()
- load_module()
- end)
- end)
- after.MouseButton1Click:Connect(function()
- id = id + 1
- if id > #modules then
- id = 1
- end
- module = modules[id]
- spawn(function()
- load_module()
- end)
- end)
- pcall(function()
- wait()
- TextButton2.Text = "<"
- TextButton3.Text = ">"
- end)
- end
- end
- function plant()
- local currentplr = plr
- planting:Play()
- local pars = nil
- repeat
- wait()
- local rp = RaycastParams.new()
- rp.FilterType = Enum.RaycastFilterType.Blacklist
- rp.FilterDescendantsInstances = {script,char,Tool0}
- rp.IgnoreWater = true
- pars = workspace:Raycast(torso.Position,torso.CFrame.upVector*-1*3.5,rp)
- until (planting.TimePosition >= 3 or not planting.IsPlaying) or (currentplr ~= plr or not CheckIfAlive or not equipped or not using or not pars)
- if (currentplr ~= plr or not CheckIfAlive or not equipped or not using or not pars) then
- planting:Stop();
- using = false
- return;
- end
- planted:Play()
- local bomb = handle:Clone()
- bomb.Anchored = false
- bomb.CanCollide = true
- bomb.CFrame = CFrame.new(pars.Position+Vector3.new(0,bomb.Size.Y/2,0))
- bomb.Parent = script
- local weld = Instance.new("Weld")
- weld.Part0 = pars.Instance
- weld.Part1 = bomb
- weld.C0 = pars.Instance.CFrame:Inverse()
- weld.C1 = bomb.CFrame:Inverse()
- weld.Parent = bomb
- if bomb and bomb.Parent then
- tool:Destroy()
- for i = 1,6 do
- create_module()
- end
- local clicker = Instance.new("ClickDetector")
- clicker.MaxActivationDistance = defuse_dist
- clicker.MouseClick:Connect(function(targplr)
- if (completed_modules < total_modules) then else return end
- local targchar,targtorso,targhum
- pcall(function()
- targchar = targplr.Character
- end)
- pcall(function()
- targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("LowerTorso") or targchar:FindFirstChild("HumanoidRootPart")
- end)
- pcall(function()
- targhum = targchar:FindFirstChildOfClass("Humanoid")
- end)
- if targplr and targchar and targtorso and targhum and targhum.Health > 0 then
- create_gui(targplr,targtorso,bomb)
- end
- end)
- clicker.Parent = bomb
- timer(bomb)
- end
- end
- tool.Equipped:Connect(function()
- char = tool.Parent
- plr = game:GetService("Players"):GetPlayerFromCharacter(char)
- hum = char:FindFirstChildOfClass("Humanoid")
- torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
- if not CheckIfAlive() then tool.Parent = nil return end
- equipped = true
- equip:Play()
- end)
- tool.Unequipped:Connect(function()
- equipped = false
- using = false
- equip:Stop()
- end)
- tool.Activated:Connect(function()
- if not using then
- using = true
- plant()
- end
- end)
- function CheckIfAlive()
- local alive = false
- 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
- alive = true
- end
- return alive
- end
Add Comment
Please, Sign In to add comment