Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- LocalScript3 = Instance.new("LocalScript")
- Script4 = Instance.new("Script")
- Script5 = Instance.new("Script")
- Tool0.Name = "SubspaceTripmine"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=11987521"
- Tool0.GripForward = Vector3.new(1, -0, -0)
- Tool0.GripPos = Vector3.new(-0.5, 0, 0)
- Tool0.GripRight = Vector3.new(0, -0, 1)
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.BrickColor = BrickColor.new("Hot pink")
- Part1.Rotation = Vector3.new(0, -74.1500015, -0.049999997)
- Part1.RotVelocity = Vector3.new(1, 1, 1)
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(2, 2, 2)
- Part1.CFrame = CFrame.new(50.7512131, 234.194107, 355.285461, 0.273154944, 0.000219101086, -0.961969852, -0.000797369401, 0.999999642, 1.34684103e-06, 0.961969614, 0.000766677491, 0.273155004)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Color = Color3.new(1, 0, 0.74902)
- Part1.Position = Vector3.new(50.7512131, 234.194107, 355.285461)
- Part1.Orientation = Vector3.new(0, -74.1500015, -0.049999997)
- Part1.Color = Color3.new(1, 0, 0.74902)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=11954776"
- SpecialMesh2.Scale = Vector3.new(0.699999988, 0.699999988, 0.699999988)
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=11954766"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- SpecialMesh2.Scale = Vector3.new(0.699999988, 0.699999988, 0.699999988)
- LocalScript3.Name = "Local Gui"
- LocalScript3.Parent = Tool0
- table.insert(cors,sandbox(LocalScript3,function()
- local Tool = script.Parent;
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
- wait(3)
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- enabled = true
- end
- function onEquippedLocal(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- Tool.Equipped:connect(onEquippedLocal)
- end))
- Script4.Name = "PlantBomb"
- Script4.Parent = Tool0
- table.insert(cors,sandbox(Script4,function()
- bombScript = script.Parent.SubspaceMine
- Tool = script.Parent
- function plant(pos)
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local spawnPos = vCharacter.PrimaryPart.Position
- local bomb = Tool.Handle:Clone()
- bomb.CanCollide = true
- bomb.Transparency = 0
- bomb.Position = pos
- bomb.Size = Vector3.new(2,2,2)
- bomb.Name = "SubspaceTripmine"
- bomb.Locked = true
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = bomb
- bomb.Parent = game.Workspace
- local new_script = bombScript:clone()
- new_script.Disabled = false
- new_script.Parent = bomb
- end
- Tool.Enabled = true
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- Tool.Handle.Transparency = 1
- plant(Tool.Handle.Position)
- wait(0)
- Tool.Handle.Transparency = 0
- Tool.Enabled = true
- end
- script.Parent.Activated:connect(onActivated)
- end))
- Script5.Name = "SubspaceMine"
- Script5.Parent = Tool0
- Script5.Disabled = true
- table.insert(cors,sandbox(Script5,function()
- Mine = script.Parent
- DunDun = Instance.new("Sound")
- DunDun.SoundId = "http://www.roblox.com/asset/?id=11984254"
- DunDun.Parent = Mine
- SubspaceExplosion = Instance.new("Sound")
- SubspaceExplosion.SoundId = "http://www.roblox.com/asset/?id=141679994"
- SubspaceExplosion.Parent = Mine
- Calibrate = Instance.new("Sound")
- Calibrate.SoundId = "http://www.roblox.com/asset/?id=161164363"
- Calibrate.Looped = true
- Calibrate.Parent = Mine
- Calibrate:Play()
- local calibration_time = 2 -- needs to be still/untouched for this long before calibrating
- local cur_time = 0
- local max_life = 120 -- these things last for 2 minutes on their own, once activated
- local calibrated = false
- local connection = nil
- function activateMine()
- for i=0,1,.1 do
- Mine.Transparency = i
- wait(.05)
- end
- calibrated = true
- Calibrate:Stop()
- end
- function pulse()
- DunDun:Play()
- for i=.9,.5,-.1 do
- Mine.Transparency = i
- wait(.05)
- end
- for i=.5,1,.1 do
- Mine.Transparency = i
- wait(.05)
- end
- end
- function explode()
- connection:disconnect()
- for i=1,0,-.2 do
- Mine.Transparency = i
- wait(.05)
- end
- SubspaceExplosion:Play()
- local e = Instance.new("Explosion")
- e.BlastRadius = 500
- e.BlastPressure = 1000000
- e.Position = Mine.Position
- e.Parent = Mine
- local creator = script.Parent:findFirstChild("creator")
- e.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
- for i=0,1,.2 do
- Mine.Transparency = i
- wait(.05)
- end
- wait(4)
- Mine:Remove()
- end
- function update()
- if (calibrated == false) then
- if (Mine.Velocity.magnitude > .05) then
- cur_time = 0
- end
- if (cur_time > calibration_time) then
- activateMine()
- end
- else
- -- calibrated mine
- if (math.random(1,20) == 2) then
- pulse()
- end
- if (cur_time > max_life) then pulse() Mine:Remove() end
- end
- end
- function OnTouch(part)
- if (calibrated == false) then
- cur_time = 0
- else
- explode()
- end
- end
- function onPlayerBlownUp(part, distance, creator)
- if (part:getMass() < 300) then
- part.BrickColor = BrickColor.new(1032)
- local s = Instance.new("Sparkles")
- s.Parent = part
- game.Debris:AddItem(s, 5)
- end
- if creator ~= nil and part.Name == "Head" then
- local humanoid = part.Parent.Humanoid
- tagHumanoid(humanoid, creator)
- end
- end
- function tagHumanoid(humanoid, creator)
- -- tag does not need to expire iff all explosions lethal
- if creator ~= nil then
- local new_tag = creator:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- connection = Mine.Touched:connect(OnTouch)
- while true do
- update()
- local e,g = wait(.5)
- cur_time = cur_time + e
- end
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement