Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Created with PenguinAnonymous's compiler
- --PenguinAnonymous is not responsible for damages caused to your game
- --This plugin does not remove things
- --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
- --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
- --Thank you for using my plugin and enjoy :)
- --It is free to use
- --If you use this plugin to create your own, please give me credit
- --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
- --Errors: Terrain,Camera,TouchTransmitter
- local mess_handle=Instance.new("Message",workspace)
- mess_handle.Text = "Inserting map, please wait"
- wait(0.5)
- for i,w in pairs(workspace:GetChildren()) do
- if w.className~="Terrain" then
- if (w~=mess_handle)and(w~=script) then
- ypcall(function() w:Destroy() end)
- end
- end
- end
- local runDummyScript = function(f,scri)
- local oldenv = getfenv(f)
- local newenv = setmetatable({}, {
- __index = function(_, k)
- if k:lower() == 'script' then
- return scri
- else
- return oldenv[k]
- end
- end
- })
- setfenv(f, newenv)
- ypcall(function() f() end)
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "CompiledModel"
- o3 = Instance.new("Model")
- o4 = Instance.new("Part")
- o5 = Instance.new("Model")
- o6 = Instance.new("Part")
- o7 = Instance.new("ManualWeld")
- o8 = Instance.new("Part")
- o9 = Instance.new("Part")
- o10 = Instance.new("Part")
- o11 = Instance.new("Tool")
- o12 = Instance.new("Part")
- o13 = Instance.new("SpecialMesh")
- o15 = Instance.new("Script")
- o16 = Instance.new("Script")
- o17 = Instance.new("LocalScript")
- o18 = Instance.new("Part")
- o19 = Instance.new("Part")
- o20 = Instance.new("ManualWeld")
- o21 = Instance.new("Part")
- o22 = Instance.new("Part")
- o23 = Instance.new("ManualWeld")
- o24 = Instance.new("Part")
- o25 = Instance.new("ManualWeld")
- o26 = Instance.new("ManualWeld")
- o27 = Instance.new("ManualWeld")
- o28 = Instance.new("Part")
- o29 = Instance.new("ManualWeld")
- o30 = Instance.new("Tool")
- o31 = Instance.new("Part")
- o32 = Instance.new("SpecialMesh")
- o33 = Instance.new("ManualWeld")
- o35 = Instance.new("LocalScript")
- o36 = Instance.new("Sound")
- o37 = Instance.new("Sound")
- o38 = Instance.new("Script")
- o39 = Instance.new("LocalScript")
- o40 = Instance.new("Part")
- o3.Parent = mas
- o4.Parent = o3
- o4.BrickColor = BrickColor.new("Grime")
- o4.Position = Vector3.new(-4.5, -0.5, 1)
- o4.Anchored = true
- o4.Size = Vector3.new(883, 1, 838)
- o4.CFrame = CFrame.new(-4.5, -0.5, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o4.Color = Color3.new(0.498039, 0.556863, 0.392157)
- o4.Position = Vector3.new(-4.5, -0.5, 1)
- o5.Parent = o3
- o6.Parent = o5
- o6.BrickColor = BrickColor.new("Pearl")
- o6.Position = Vector3.new(25.5, 15.9999943, 4.5)
- o6.Anchored = true
- o6.Size = Vector3.new(1, 10, 49)
- o6.CFrame = CFrame.new(25.5, 15.9999943, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o6.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- o6.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o6.Position = Vector3.new(25.5, 15.9999943, 4.5)
- o7.Name = "Part-to-Part Strong Joint"
- o7.Parent = o6
- o7.C0 = CFrame.new(-0.5, -5, 24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o7.C1 = CFrame.new(24.5, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o7.Part0 = o6
- o7.Part1 = o19
- o8.Parent = o5
- o8.BrickColor = BrickColor.new("Really red")
- o8.Position = Vector3.new(0.5, 21.4999962, 4.5)
- o8.Anchored = true
- o8.Size = Vector3.new(51, 1, 51)
- o8.CFrame = CFrame.new(0.5, 21.4999962, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o8.Color = Color3.new(1, 0, 0)
- o8.Position = Vector3.new(0.5, 21.4999962, 4.5)
- o9.Parent = o5
- o9.BrickColor = BrickColor.new("Really red")
- o9.Position = Vector3.new(0.5, 23.4999962, 4.5)
- o9.Anchored = true
- o9.Size = Vector3.new(51, 1, 47)
- o9.CFrame = CFrame.new(0.5, 23.4999962, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o9.Color = Color3.new(1, 0, 0)
- o9.Position = Vector3.new(0.5, 23.4999962, 4.5)
- o10.Parent = o5
- o10.BrickColor = BrickColor.new("Dark stone grey")
- o10.Position = Vector3.new(0.5, 0.500001013, 4.5)
- o10.Anchored = true
- o10.Size = Vector3.new(51, 1, 51)
- o10.CFrame = CFrame.new(0.5, 0.500001013, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o10.Color = Color3.new(0.388235, 0.372549, 0.384314)
- o10.Position = Vector3.new(0.5, 0.500001013, 4.5)
- o11.Name = "ClassicTimebomb"
- o11.Parent = o5
- o11.TextureId = "rbxasset://Textures/Bomb.png"
- o11.GripForward = Vector3.new(-0, 1, -0)
- o11.GripUp = Vector3.new(0, 0, 1)
- o12.Name = "Handle"
- o12.Parent = o11
- o12.Position = Vector3.new(-21.579998, 11.8800116, 13.3701639)
- o12.Rotation = Vector3.new(-89.9499969, 0, 180)
- o12.Anchored = true
- o12.FormFactor = Enum.FormFactor.Symmetric
- o12.Shape = Enum.PartType.Ball
- o12.Size = Vector3.new(2, 2, 2)
- o12.CFrame = CFrame.new(-21.579998, 11.8800116, 13.3701639, -1.00000298, -7.90887407e-06, -6.02934449e-07, 1.78755056e-06, -0.000796278182, 1.00000131, -7.90788454e-06, 1.0000037, 0.000796279695)
- o12.BottomSurface = Enum.SurfaceType.Smooth
- o12.TopSurface = Enum.SurfaceType.Smooth
- o12.Position = Vector3.new(-21.579998, 11.8800116, 13.3701639)
- o13.Parent = o12
- o13.MeshId = "rbxasset://fonts/timebomb.mesh"
- o13.TextureId = "rbxasset://textures/bombtex.png"
- o13.MeshType = Enum.MeshType.FileMesh
- o15.Name = "PlantBomb"
- o15.Parent = o11
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local bombScript = script.Parent.Bomb
- local Tool = script.Parent
- local Bomb = Tool.Handle
- function plant()
- local bomb2 = Instance.new("Part")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local spawnPos = Bomb.Position
- bomb2.Position = Vector3.new(spawnPos.x, spawnPos.y+3, spawnPos.z)
- bomb2.Size = Vector3.new(2,2,2)
- bomb2.BrickColor = BrickColor.new(21)
- bomb2.Shape = 0
- bomb2.BottomSurface = 0
- bomb2.TopSurface = 0
- bomb2.Reflectance = 1
- bomb2.Name = "TimeBomb"
- bomb2.Locked = true
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = bomb2
- bomb2.Parent = game.Workspace
- local new_script = bombScript:clone()
- new_script.Disabled = false
- new_script.Parent = bomb2
- 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
- Bomb.Transparency = 1.0
- plant()
- wait(6)
- Bomb.Transparency = 0.0
- Tool.Enabled = true
- end
- function onUnequipped()
- end
- Tool.Activated:connect(onActivated)
- Tool.Unequipped:connect(onUnequipped)
- end,o15)
- end))
- o16.Name = "Bomb"
- o16.Parent = o11
- o16.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local updateInterval = .4
- local currentColor = 1
- local colors = {26, 21}
- local ticksound = Instance.new("Sound")
- ticksound.SoundId = "rbxasset://sounds\\clickfast.wav"
- ticksound.Parent = script.Parent
- function update()
- updateInterval = updateInterval * .9
- script.Parent.BrickColor = BrickColor.new(colors[currentColor])
- currentColor = currentColor + 1
- if (currentColor > 2) then currentColor = 1 end
- end
- function blowUp()
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
- sound.Parent = script.Parent
- sound.Volume = 1
- sound:play()
- explosion = Instance.new("Explosion")
- explosion.BlastRadius = 12
- explosion.BlastPressure = 1000000 -- these are really wussy units
- -- find instigator tag
- local creator = script.Parent:findFirstChild("creator")
- if creator ~= nil then
- explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
- end
- explosion.Position = script.Parent.Position
- explosion.Parent = game.Workspace
- script.Parent.Transparency = 1
- end
- function onPlayerBlownUp(part, distance, creator)
- if 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
- while updateInterval > .1 do
- wait(updateInterval)
- update()
- ticksound:play()
- end
- blowUp()
- wait(2)
- script.Parent:remove()
- end,o16)
- end))
- o17.Name = "MouseIcon"
- o17.Parent = o11
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
- local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
- local Tool = script.Parent
- local Mouse = nil
- local function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
- end
- end
- local function OnEquipped(mouse)
- Mouse = mouse
- UpdateIcon()
- end
- local function OnChanged(property)
- if property == 'Enabled' then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end,o17)
- end))
- o18.Parent = o5
- o18.BrickColor = BrickColor.new("Pearl")
- o18.Position = Vector3.new(25.5, 5.99999714, 20)
- o18.Anchored = true
- o18.Size = Vector3.new(1, 10, 18)
- o18.CFrame = CFrame.new(25.5, 5.99999714, 20, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o18.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o18.Position = Vector3.new(25.5, 5.99999714, 20)
- o19.Parent = o5
- o19.BrickColor = BrickColor.new("Pearl")
- o19.Position = Vector3.new(0.5, 10.9999943, 29.5)
- o19.Anchored = true
- o19.Size = Vector3.new(51, 20, 1)
- o19.CFrame = CFrame.new(0.5, 10.9999943, 29.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o19.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o19.Position = Vector3.new(0.5, 10.9999943, 29.5)
- o20.Name = "Part-to-Part Strong Joint"
- o20.Parent = o19
- o20.C0 = CFrame.new(25.5, -10, -0.5, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- o20.C1 = CFrame.new(0.5, -5, 9, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- o20.Part0 = o19
- o20.Part1 = o18
- o21.Parent = o5
- o21.BrickColor = BrickColor.new("Pearl")
- o21.Position = Vector3.new(25.5, 10.4999943, -1.5)
- o21.Anchored = true
- o21.Size = Vector3.new(1, 1, 1)
- o21.CFrame = CFrame.new(25.5, 10.4999943, -1.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o21.BottomSurface = Enum.SurfaceType.Hinge
- o21.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o21.Position = Vector3.new(25.5, 10.4999943, -1.5)
- o22.Parent = o5
- o22.BrickColor = BrickColor.new("Pearl")
- o22.Position = Vector3.new(-24.5, 10.9999943, 4.5)
- o22.Anchored = true
- o22.Size = Vector3.new(1, 20, 49)
- o22.CFrame = CFrame.new(-24.5, 10.9999943, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o22.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o22.Position = Vector3.new(-24.5, 10.9999943, 4.5)
- o23.Name = "Part-to-Part Strong Joint"
- o23.Parent = o22
- o23.C0 = CFrame.new(-0.5, -10, 24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o23.C1 = CFrame.new(-25.5, -10, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o23.Part0 = o22
- o23.Part1 = o19
- o24.Parent = o5
- o24.BrickColor = BrickColor.new("Pearl")
- o24.Position = Vector3.new(0.5, 10.9999943, -20.5)
- o24.Anchored = true
- o24.Size = Vector3.new(51, 20, 1)
- o24.CFrame = CFrame.new(0.5, 10.9999943, -20.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o24.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o24.Position = Vector3.new(0.5, 10.9999943, -20.5)
- o25.Name = "Part-to-Part Strong Joint"
- o25.Parent = o24
- o25.C0 = CFrame.new(-25.5, -10, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o25.C1 = CFrame.new(-0.5, -10, -24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o25.Part0 = o24
- o25.Part1 = o22
- o26.Name = "Part-to-Part Strong Joint"
- o26.Parent = o24
- o26.C0 = CFrame.new(-25.5, -10, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o26.C1 = CFrame.new(-50.5, -15, -24.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o26.Part0 = o24
- o26.Part1 = o6
- o27.Name = "Part-to-Part Strong Joint"
- o27.Parent = o24
- o27.C0 = CFrame.new(-25.5, -10, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o27.C1 = CFrame.new(-50.5, -5, -9, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o27.Part0 = o24
- o27.Part1 = o28
- o28.Parent = o5
- o28.BrickColor = BrickColor.new("Pearl")
- o28.Position = Vector3.new(25.5, 5.99999714, -11)
- o28.Anchored = true
- o28.Size = Vector3.new(1, 10, 18)
- o28.CFrame = CFrame.new(25.5, 5.99999714, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o28.Color = Color3.new(0.905882, 0.905882, 0.92549)
- o28.Position = Vector3.new(25.5, 5.99999714, -11)
- o29.Name = "Part-to-Part Strong Joint"
- o29.Parent = o28
- o29.C0 = CFrame.new(-0.5, -5, 9, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o29.C1 = CFrame.new(-0.5, -9.5, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o29.Part0 = o28
- o29.Part1 = o21
- o30.Name = "RocketLauncher"
- o30.Parent = o5
- o30.TextureId = "http://www.roblox.com/asset/?id=90021376"
- o30.GripForward = Vector3.new(1, -0, -0)
- o30.GripPos = Vector3.new(0.699999988, 0, -0.5)
- o30.GripRight = Vector3.new(0, -1, 0)
- o30.GripUp = Vector3.new(0, 0, 1)
- o30.CanBeDropped = false
- o31.Name = "Handle"
- o31.Parent = o30
- o31.Position = Vector3.new(-23, 9.42003155, 13)
- o31.Rotation = Vector3.new(-90, -90, 0)
- o31.Anchored = true
- o31.CanCollide = false
- o31.FormFactor = Enum.FormFactor.Custom
- o31.Size = Vector3.new(4.92000628, 0.740000546, 0.839999795)
- o31.CFrame = CFrame.new(-23, 9.42003155, 13, -5.96046448e-07, 0, -1.00000179, 1.00000095, 6.30171271e-05, 5.96046448e-07, 6.30170543e-05, -1.00000215, 3.63797881e-11)
- o31.BottomSurface = Enum.SurfaceType.Smooth
- o31.TopSurface = Enum.SurfaceType.Smooth
- o31.Position = Vector3.new(-23, 9.42003155, 13)
- o32.Parent = o31
- o32.MeshId = "rbxasset://fonts/rocketlauncher.mesh"
- o32.Scale = Vector3.new(0.75, 0.75, 0.75)
- o32.TextureId = "rbxasset://textures/rocketlaunchertex.png"
- o32.MeshType = Enum.MeshType.FileMesh
- o33.Name = "Handle-to-Handle Strong Joint"
- o33.Parent = o31
- o33.C0 = CFrame.new(2.46000314, -0.370000273, -0.419999897, -0.99999994, 0, 0, 0, 1, 0, 0, 0, -0.99999994)
- o33.C1 = CFrame.new(1, 0, 0, -1.19100412e-06, 7.90797912e-06, -1.00000131, 0.000733260298, -1.00000155, -7.90929789e-06, -1.00000048, -0.000733261055, -6.88774593e-09)
- o33.Part0 = o31
- o33.Part1 = o12
- o35.Name = "Launcher"
- o35.Parent = o30
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- -----------------
- --| Constants |--
- -----------------
- local GRAVITY_ACCELERATION = 196.2
- local RELOAD_TIME = 3 -- Seconds until tool can be used again
- local ROCKET_SPEED = 60 -- Speed of the projectile
- local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534'
- local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
- local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
- -----------------
- --| Variables |--
- -----------------
- local DebrisService = Game:GetService('Debris')
- local PlayersService = Game:GetService('Players')
- local MyPlayer = PlayersService.LocalPlayer
- local Tool = script.Parent
- local ToolHandle = Tool.Handle
- local RocketScript = script:WaitForChild('Rocket')
- local SwooshSound = script:WaitForChild('Swoosh')
- local BoomSound = script:WaitForChild('Boom')
- --NOTE: We create the rocket once and then clone it when the player fires
- local Rocket = Instance.new('Part') do
- -- Set up the rocket part
- Rocket.Name = 'Rocket'
- Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
- Rocket.Size = ROCKET_PART_SIZE
- Rocket.CanCollide = false
- -- Add the mesh
- local mesh = Instance.new('SpecialMesh', Rocket)
- mesh.MeshId = MISSILE_MESH_ID
- mesh.Scale = MISSILE_MESH_SCALE
- -- Add fire
- local fire = Instance.new('Fire', Rocket)
- fire.Heat = 5
- fire.Size = 2
- -- Add a force to counteract gravity
- local bodyForce = Instance.new('BodyForce', Rocket)
- bodyForce.Name = 'Antigravity'
- bodyForce.force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0)
- -- Clone the sounds and set Boom to PlayOnRemove
- local swooshSoundClone = SwooshSound:Clone()
- swooshSoundClone.Parent = Rocket
- local boomSoundClone = BoomSound:Clone()
- boomSoundClone.PlayOnRemove = true
- boomSoundClone.Parent = Rocket
- -- Attach creator tags to the rocket early on
- local creatorTag = Instance.new('ObjectValue', Rocket)
- creatorTag.Value = MyPlayer
- creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
- local iconTag = Instance.new('StringValue', creatorTag)
- iconTag.Value = Tool.TextureId
- iconTag.Name = 'icon'
- -- Finally, clone the rocket script and enable it
- local rocketScriptClone = RocketScript:Clone()
- rocketScriptClone.Parent = Rocket
- rocketScriptClone.Disabled = false
- end
- -----------------
- --| Functions |--
- -----------------
- local function OnActivated()
- local myModel = MyPlayer.Character
- if Tool.Enabled and myModel and myModel:FindFirstChild('Humanoid') and myModel.Humanoid.Health > 0 then
- Tool.Enabled = false
- -- Create a clone of Rocket and set its color
- local rocketClone = Rocket:Clone()
- DebrisService:AddItem(rocketClone, 30)
- rocketClone.BrickColor = MyPlayer.TeamColor
- -- Position the rocket clone and launch!
- local spawnPosition = (ToolHandle.CFrame * CFrame.new(2, 0, 0)).p
- rocketClone.CFrame = CFrame.new(spawnPosition, myModel.Humanoid.TargetPoint) --NOTE: This must be done before assigning Parent
- rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
- rocketClone.Parent = Workspace
- wait(RELOAD_TIME)
- Tool.Enabled = true
- end
- end
- --------------------
- --| Script Logic |--
- --------------------
- Tool.Activated:connect(OnActivated)
- end,o35)
- end))
- o36.Name = "Swoosh"
- o36.Parent = o35
- o36.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
- o36.Volume = 0.69999998807907
- o36.Looped = true
- o37.Name = "Boom"
- o37.Parent = o35
- o37.SoundId = "rbxasset://sounds/collide.wav"
- o37.Volume = 1
- o38.Name = "Rocket"
- o38.Parent = o35
- o38.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- -----------------
- --| Constants |--
- -----------------
- local BLAST_RADIUS = 8 -- Blast radius of the explosion
- local BLAST_DAMAGE = 60 -- Amount of damage done to players
- local BLAST_FORCE = 1000 -- Amount of force applied to parts
- local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
- --NOTE: Keys must be lowercase, values must evaluate to true
- -----------------
- --| Variables |--
- -----------------
- local DebrisService = Game:GetService('Debris')
- local PlayersService = Game:GetService('Players')
- local Rocket = script.Parent
- local CreatorTag = Rocket:WaitForChild('creator')
- local SwooshSound = Rocket:WaitForChild('Swoosh')
- -----------------
- --| Functions |--
- -----------------
- -- Removes any old creator tags and applies a new one to the target
- local function ApplyTags(target)
- while target:FindFirstChild('creator') do
- target.creator:Destroy()
- end
- local creatorTagClone = CreatorTag:Clone()
- DebrisService:AddItem(creatorTagClone, 1.5)
- creatorTagClone.Parent = target
- end
- -- Returns the ancestor that contains a Humanoid, if it exists
- local function FindCharacterAncestor(subject)
- if subject and subject ~= Workspace then
- local humanoid = subject:FindFirstChild('Humanoid')
- if humanoid then
- return subject, humanoid
- else
- return FindCharacterAncestor(subject.Parent)
- end
- end
- return nil
- end
- -- Customized explosive effect that doesn't affect teammates and only breaks joints on dead parts
- local function OnExplosionHit(hitPart, hitDistance, blastCenter)
- if hitPart and hitDistance then
- local character, humanoid = FindCharacterAncestor(hitPart.Parent)
- if character then
- local myPlayer = CreatorTag.Value
- if myPlayer and not myPlayer.Neutral then -- Ignore friendlies caught in the blast
- local player = PlayersService:GetPlayerFromCharacter(character)
- if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
- return
- end
- end
- end
- if humanoid and humanoid.Health > 0 then -- Humanoids are tagged and damaged
- if hitPart.Name == 'Torso' then
- ApplyTags(humanoid)
- humanoid:TakeDamage(BLAST_DAMAGE)
- end
- else -- Loose parts and dead parts are blasted
- if hitPart.Name ~= 'Handle' then
- hitPart:BreakJoints()
- local blastForce = Instance.new('BodyForce', hitPart) --NOTE: We will multiply by mass so bigger parts get blasted more
- blastForce.force = (hitPart.Position - blastCenter).unit * BLAST_FORCE * hitPart:GetMass()
- DebrisService:AddItem(blastForce, 0.1)
- end
- end
- end
- end
- local function OnTouched(otherPart)
- if Rocket and otherPart then
- -- Fly through anything in the ignore list
- if IGNORE_LIST[string.lower(otherPart.Name)] then
- return
- end
- local myPlayer = CreatorTag.Value
- if myPlayer then
- -- Fly through the creator
- if myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
- return
- end
- -- Fly through friendlies
- if not myPlayer.Neutral then
- local character = FindCharacterAncestor(otherPart.Parent)
- local player = PlayersService:GetPlayerFromCharacter(character)
- if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
- return
- end
- end
- end
- -- Fly through terrain water
- if otherPart == Workspace.Terrain then
- --NOTE: If the rocket is large, then the simplifications made here will cause it to fly through terrain in some cases
- local frontOfRocket = Rocket.Position + (Rocket.CFrame.lookVector * (Rocket.Size.Z / 2))
- local cellLocation = Workspace.Terrain:WorldToCellPreferSolid(frontOfRocket)
- local cellMaterial = Workspace.Terrain:GetCell(cellLocation.X, cellLocation.Y, cellLocation.Z)
- if cellMaterial == Enum.CellMaterial.Water or cellMaterial == Enum.CellMaterial.Empty then
- return
- end
- end
- -- Create the explosion
- local explosion = Instance.new('Explosion')
- explosion.BlastPressure = 0 -- Completely safe explosion
- explosion.BlastRadius = BLAST_RADIUS
- explosion.ExplosionType = Enum.ExplosionType.NoCraters
- explosion.Position = Rocket.Position
- explosion.Parent = Workspace
- -- Connect custom logic for the explosion
- explosion.Hit:connect(function(hitPart, hitDistance) OnExplosionHit(hitPart, hitDistance, explosion.Position) end)
- -- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket
- script.Parent = explosion
- CreatorTag.Parent = script
- Rocket:Destroy()
- end
- end
- --------------------
- --| Script Logic |--
- --------------------
- SwooshSound:Play()
- Rocket.Touched:connect(OnTouched)
- end,o38)
- end))
- o39.Name = "MouseIcon"
- o39.Parent = o30
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- local MOUSE_ICON = 'rbxasset://textures/GunCursor.png'
- local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
- local Tool = script.Parent
- local Mouse = nil
- local function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
- end
- end
- local function OnEquipped(mouse)
- Mouse = mouse
- UpdateIcon()
- end
- local function OnChanged(property)
- if property == 'Enabled' then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end,o39)
- end))
- o40.Parent = o5
- o40.BrickColor = BrickColor.new("Really red")
- o40.Position = Vector3.new(0.5, 22.4999962, 4.5)
- o40.Anchored = true
- o40.Size = Vector3.new(51, 1, 49)
- o40.CFrame = CFrame.new(0.5, 22.4999962, 4.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- o40.Color = Color3.new(1, 0, 0)
- o40.Position = Vector3.new(0.5, 22.4999962, 4.5)
- mas.Parent = workspace
- mas:MakeJoints()
- local mas1 = mas:GetChildren()
- for i=1,#mas1 do
- mas1[i].Parent = workspace
- ypcall(function() mas1[i]:MakeJoints() end)
- end
- mas:Destroy()
- for i=1,#cors do
- coroutine.resume(cors[i])
- end
- mess_handle.Text = "Resetting"
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- v:LoadCharacter()
- end
- wait(1)
- mess_handle:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement