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
- --Errors: Camera
- 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"
- o1 = Instance.new("Tool")
- o2 = Instance.new("Script")
- o3 = Instance.new("LocalScript")
- o4 = Instance.new("Part")
- o5 = Instance.new("Sound")
- o6 = Instance.new("Sound")
- o7 = Instance.new("SpecialMesh")
- o9 = Instance.new("Vector3Value")
- o10 = Instance.new("IntValue")
- o11 = Instance.new("BoolValue")
- o12 = Instance.new("IntValue")
- o13 = Instance.new("BoolValue")
- o14 = Instance.new("Animation")
- o15 = Instance.new("BoolValue")
- o16 = Instance.new("ScreenGui")
- o17 = Instance.new("Frame")
- o18 = Instance.new("Frame")
- o19 = Instance.new("TextLabel")
- o20 = Instance.new("TextLabel")
- o21 = Instance.new("LocalScript")
- o22 = Instance.new("SpecialMesh")
- o23 = Instance.new("SpecialMesh")
- o24 = Instance.new("LocalScript")
- o25 = Instance.new("LocalScript")
- o1.Name = "DL-44"
- o1.Parent = mas
- o1.GripForward = Vector3.new(-4.37113883e-08, 1.91068547e-15, -1)
- o1.GripPos = Vector3.new(3.05979704e-08, -0.400000006, 0.599999964)
- o1.GripRight = Vector3.new(1, 0, -4.37113883e-08)
- o1.GripUp = Vector3.new(0, 1, 1.91068547e-15)
- o1.ToolTip = "DL-44 Blaster"
- o2.Name = "Firescript"
- o2.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- -- Made by Stickmasterluke
- -- edited by fusroblox
- local Tool = script.Parent
- local check = true
- local GunDamage = 20 -- Base output damage per shot.
- local FireRate = .25 -- How often the weapon can fire.
- local Automatic = false -- hold down to continue firing
- local Range = 250 -- Max distance that the weapon can fire.
- local Spread = 6 -- The bigger the spread, the more inaccurate the shots will be.
- local ClipSize = 9 -- Shots in a clip
- local ReloadTime = 1.3 -- Time it takes to reload the tool.
- local StartingClips = 10 -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
- local SegmentLength = 40 -- How long the shot segments are, or the speed of the shot.
- local FadeDelayTime = 1/30
- local BarrelPos = CFrame.new(0, 0, - 1.2) -- L, F, U
- local Rate = 1/30
- local Intangibles = {"Shock", "Bolt", "Bullet", "Plasma", "Effect", "Laser", "Handle", "Effects", "Effect", "Flash"}
- local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
- local FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"}
- local Reloading = false
- local Debris = game:GetService("Debris")
- local Ammo = Tool:FindFirstChild("Ammo")
- if Ammo ~= nil then
- Ammo.Value = ClipSize
- end
- local Clips = Tool:FindFirstChild("Clips")
- if Clips ~= nil then
- Clips.Value = StartingClips
- end
- Tool.Equipped:connect(function()
- Tool.Handle.Fire:Stop()
- Tool.Handle.Reload:Stop()
- end)
- Tool.Unequipped:connect(function()
- Tool.Handle.Fire:Stop()
- Tool.Handle.Reload:Stop()
- end)
- function Round(number, decimal)
- decimal = decimal or 0
- local mult = 10^decimal
- return math.floor(number * mult + .5)/mult
- end
- function CheckIntangible(t)
- for i3, v3 in ipairs(Intangibles) do
- if string.lower(v3) == string.lower(t.Name) or t.Transparency == 1 then
- return true
- end
- end
- return false
- end
- function Reload()
- Reloading = true
- Tool.Reloading.Value = true
- if Clips ~= nil then
- if Clips.Value > 0 then
- Clips.Value = Clips.Value - 1
- else
- Reloading = false
- Tool.Reloading.Value = false
- return
- end
- end
- Tool.Handle.Reload:Play()
- for i = 1, ClipSize do
- wait(ReloadTime/ClipSize)
- Ammo.Value = i
- end
- Reloading = false
- Tool.Reloading.Value = false
- end
- function CastRay(startpos, vec, length, ignore, delayifhit)
- if length > 999 then
- length = 999
- end
- hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore)
- if hit ~= nil then
- if CheckIntangible(hit) then
- if delayifhit then
- wait()
- end
- hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit)
- end
- end
- return hit, endpos2
- end
- function SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
- if Ammo ~= nil then
- if Ammo.Value > 0 then
- Ammo.Value = Ammo.Value - 1
- else
- Reload()
- return
- end
- end
- Tool.Handle.Fire.Pitch = (math.random() * .5) + .75
- Tool.Handle.Fire:Play()
- Tool.DoFireAni.Value = not Tool.DoFireAni.Value
- print(Tool.Handle.Fire.Pitch)
- local boltdist = Range
- local clickdist = (boltstart - targetpos).magnitude
- local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100) * fuzzyness)
- local boltvec = (targetpos - boltstart).unit
- local totalsegments = math.ceil(boltdist/SegmentLength)
- local lastpos = boltstart
- for i = 1, totalsegments do
- local newpos = (boltstart + (boltvec * (boltdist * (i/totalsegments))))
- local segvec = (newpos - lastpos).unit
- local boltlength = (newpos - lastpos).magnitude
- local bolthit, endpos = CastRay(lastpos, segvec, boltlength, ignore, false)
- DrawBeam(lastpos, endpos, clr, fadedelay)
- if bolthit ~= nil then
- local h = bolthit.Parent:FindFirstChild("Humanoid")
- if h ~= nil then
- local plr = game.Players:GetPlayerFromCharacter(Tool.Parent)
- if plr ~= nil then
- local creator = Instance.new("ObjectValue")
- creator.Name = "creator"
- creator.Value = plr
- creator.Parent = h
- end
- if hit.Parent:FindFirstChild("BlockShot") then
- hit.Parent:FindFirstChild("BlockShot"):Fire(newpos)
- delay(0, function() HitEffect(endpos, 10) end)
- else
- h:TakeDamage(damage)
- end
- else
- delay(0, function() HitEffect(endpos, 5) end)
- end
- break
- end
- lastpos = endpos
- wait(Rate)
- end
- end
- function DrawBeam(beamstart, beamend, clr, fadedelay)
- local dis = (beamstart - beamend).magnitude
- local laser = Instance.new("Part")
- laser.Name = "Bullet"
- laser.Anchored = true
- laser.CanCollide = false
- laser.Shape = "Block"
- laser.formFactor = "Custom"
- laser.Size = Vector3.new(.2, .2, dis + .2)
- laser.Material = Enum.Material.Neon
- laser.Locked = true
- laser.TopSurface = 0
- laser.BottomSurface = 0
- laser.BrickColor = clr
- laser.CFrame = CFrame.new(beamend, beamstart) * CFrame.new(0, 0, - dis/2)
- laser.Parent = game.Workspace
- Debris:AddItem(laser, fadedelay)
- end
- function SigNum(num)
- if num == 0 then return 1 end
- return math.abs(num)/num
- end
- function MakeSpark(pos)
- local effect = Instance.new("Part")
- effect.Name = "Effect"
- effect.Anchored = false
- effect.CanCollide = false
- effect.Shape = "Block"
- effect.formFactor = "Custom"
- effect.Material = Enum.Material.Neon
- effect.Locked = true
- effect.TopSurface = 0
- effect.BottomSurface = 0
- effect.BrickColor = Colors[1]
- effect.CFrame = CFrame.new(pos)
- effect.Parent = game.Workspace
- -- effect.velocity = Vector3.new(math.random() * 10, math.random() * 10, math.random() * 10)
- -- effect.Size = Vector3.new(effect.velocity.x, effect.velocity.y, effect.velocity.z)
- local effectVel = Instance.new("BodyVelocity")
- effectVel.maxForce = Vector3.new(99999, 99999, 99999)
- effectVel.velocity = Vector3.new(math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)), math.random() * 15 * SigNum(math.random( - 10, 10)))
- effectVel.Parent = effect
- effect.Size = Vector3.new(math.abs(effectVel.velocity.x)/20, math.abs(effectVel.velocity.y)/20, math.abs(effectVel.velocity.z)/20)
- wait()
- effectVel:Destroy()
- local effecttime = .25
- Debris:AddItem(effect, effecttime * 2)
- local startTime = time()
- while time() - startTime < effecttime do
- if effect ~= nil then
- effect.Transparency = (time() - startTime)/effecttime
- end
- wait()
- end
- if effect ~= nil then
- effect.Parent = nil
- end
- end
- function HitEffect(pos)
- for i = 0, 10, 1 do
- local thread = coroutine.create(MakeSpark)
- coroutine.resume(thread, pos)
- end
- end
- Tool.Down.Changed:connect(function()
- while Tool.Down.Value and check and not Reloading do
- check = false
- local humanoid = Tool.Parent:FindFirstChild("Humanoid")
- local plr1 = game.Players:GetPlayerFromCharacter(Tool.Parent)
- if humanoid ~= nil and plr1 ~= nil then
- if humanoid.Health > 0 then
- spos1 = (Tool.Handle.CFrame * BarrelPos).p
- delay(0, function() SendBullet(spos1, Tool.Aim.Value, Spread, SegmentLength, Tool.Parent, Colors[1], GunDamage, FadeDelayTime) end)
- else
- check = true
- break
- end
- else
- check = true
- break
- end
- wait(FireRate)
- check = true
- if not Automatic then
- break
- end
- end
- end)
- end,o2)
- end))
- o3.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- -- Made by Stickmasterluke
- -- edited by fusroblox
- function WaitForChild(obj, name)
- while not obj:FindFirstChild(name) do
- wait()
- print("1waiting for " .. name)
- end
- return obj:FindFirstChild(name)
- end
- local Reloading = "http://www.roblox.com/asset/?id=50911776"
- local Cursors = {
- "http://www.roblox.com/asset/?id=50912619", -- red -- change the cursors
- "http://www.roblox.com/asset/?id=50912641", -- blue
- "http://www.roblox.com/asset/?id=50911776", -- purple
- Reloading = "http://www.roblox.com/asset/?id=50911776", }
- local ClipSize = 9
- local Equipped = false
- local Tool = script.Parent
- local Player = game.Players.localPlayer
- local Ammo = WaitForChild(Tool,"Ammo")
- local Clips = nil
- local Gui = nil
- while Gui == nil do
- wait()
- Gui = Tool:FindFirstChild("PlasmaAssaultGui")
- end
- function UpdateGui()
- if Equipped then
- local Player = game.Players.localPlayer
- if Player ~= nil then
- if Ammo == nil then
- Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol" --Tool.Name
- Gui.Bar.AmmoLabel.Text = ""
- Gui.Bar.Fill.Size = UDim2.new( - 1, 0, .8, 0)
- elseif Clips == nil then
- Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"-- Tool.Name
- Gui.Bar.AmmoLabel.Text = tostring(Ammo.Value).."/"..tostring(ClipSize)
- Gui.Bar.Fill.Size = UDim2.new( - 1 * Ammo.Value/ClipSize, 0, .8, 0)
- Gui.Bar.Fill.Visible = true
- else
- Gui.Bar.GunLabel.Text = "Futuro Heavy Pistol"--Tool.Name
- Gui.Bar.AmmoLabel.Text = tostring(Ammo.Value).."/"..tostring(ClipSize).." "..tostring(Clips.Value)
- Gui.Bar.Fill.Size = UDim2.new( - 1 * Ammo.Value/ClipSize, 0, .8, 0)
- Gui.Bar.Fill.Visible = true
- end
- Gui.Bar.Fill.BackgroundColor3 = Color3.new(255, 0, 0)
- if Tool.Reloading.Value then
- Gui.Bar.AmmoLabel.Text = "Reloading"
- end
- end
- end
- end
- function OnEquipped(mouse)
- if mouse ~= nil then
- Equipped = true
- local Player = game.Players.LocalPlayer
- if Player ~= nil then
- local plrgui = WaitForChild(Player,"PlayerGui")
- if plrgui ~= nil then
- Gui.Parent = plrgui
- end
- mouse.Button1Down:connect(function()
- if not Tool.Down.Value then
- Tool.Aim.Value = mouse.Hit.p
- Tool.Down.Value = true
- while Tool.Down.Value do
- Tool.Aim.Value = mouse.Hit.p
- wait()
- end
- end
- end)
- mouse.Button1Up:connect(function()
- Tool.Down.Value = false
- end)
- mouse.Icon = Cursors[1]
- Tool.Reloading.Changed:connect(function(val)
- if mouse ~= nil and Equipped then
- if val then
- mouse.Icon = Cursors.Reloading
- else
- mouse.Icon = Cursors[1]
- end
- local Player = game.Players.localPlayer
- if Player ~= nil then
- local gui = WaitForChild(Player.PlayerGui, "AmmoHud")
- if gui ~= nil then
- UpdateGui()
- if Tool.Reloading.Value then
- gui.Bar.AmmoLabel.Text = "Reloading"
- end
- end
- end
- end
- end)
- UpdateGui()
- end
- end
- end
- function OnUnequipped()
- Gui.Parent = Tool
- Equipped = false
- local Player = game.Players.localPlayer
- if Player ~= nil then
- local gui = WaitForChild(Player.PlayerGui,"AmmoHud")
- if gui ~= nil then
- gui.Bar.GunLabel.Text = ""
- gui.Bar.AmmoLabel.Text = ""
- gui.Bar.Fill.Visible = false
- end
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- if Ammo ~= nil then
- Ammo.Changed:connect(function()
- UpdateGui()
- end)
- if Clips ~= nil then
- Clips.Changed:connect(function()
- UpdateGui()
- end)
- end
- end
- while Tool:FindFirstChild("Reloading") == nil do
- wait(1)
- end
- Tool.Reloading.Changed:connect(function()
- UpdateGui()
- end)
- function PlayFireAni()
- local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.FireAni)
- aniTrack:Play()
- end
- Tool.DoFireAni.Changed:connect(PlayFireAni)
- end,o3)
- end))
- o4.Name = "Handle"
- o4.Parent = o1
- o4.BrickColor = BrickColor.new("Really black")
- o4.Position = Vector3.new(60.3701706, 0.876942992, 174.099655)
- o4.Rotation = Vector3.new(130.229996, 60.5800018, -134.160004)
- o4.FormFactor = Enum.FormFactor.Custom
- o4.Size = Vector3.new(0.840000033, 1.18000245, 1.75999904)
- o4.CFrame = CFrame.new(60.3701706, 0.876942992, 174.099655, -0.342172682, 0.352322668, 0.871084034, 5.35202247e-08, 0.927042186, -0.374955863, -0.939637184, -0.128299654, -0.317208648)
- o4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- o4.Position = Vector3.new(60.3701706, 0.876942992, 174.099655)
- o4.Orientation = Vector3.new(22.0200005, 110.010002, 0)
- o4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- o5.Name = "Fire"
- o5.Parent = o4
- o5.Pitch = 0.82116913795471
- o5.SoundId = "http://www.roblox.com/asset/?id=145711747"
- o5.Volume = 0.75
- o6.Name = "Reload"
- o6.Parent = o4
- o6.SoundId = "http://www.roblox.com/asset/?id=131436135"
- o6.Volume = 0.25
- o7.Parent = o4
- o7.MeshId = "http://www.roblox.com/asset?id=156298302"
- o7.TextureId = "http://www.roblox.com/asset/?id=157853834"
- o7.MeshType = Enum.MeshType.FileMesh
- o9.Name = "Aim"
- o9.Parent = o1
- o9.Value = Vector3.new(7370.47461, -428.252258, -6819.59961)
- o10.Name = "Ammo"
- o10.Parent = o1
- o11.Name = "Down"
- o11.Parent = o1
- o12.Name = "NoClips"
- o12.Parent = o1
- o13.Name = "Reloading"
- o13.Parent = o1
- o14.Name = "FireAni"
- o14.Parent = o1
- o14.AnimationId = "http://www.roblox.com/Asset?ID=89456847"
- o15.Name = "DoFireAni"
- o15.Parent = o1
- o16.Name = "PlasmaAssaultGui"
- o16.Parent = o1
- o17.Name = "Bar"
- o17.Parent = o16
- o17.Position = UDim2.new(1,-270,1,-70)
- o17.Size = UDim2.new(0,200,0,60)
- o17.Style = Enum.FrameStyle.RobloxRound
- o17.Position = UDim2.new(1,-270,1,-70)
- o18.Name = "Fill"
- o18.Parent = o17
- o18.Position = UDim2.new(1,0,0.20000000298023,0)
- o18.Size = UDim2.new(-1,0,0.80000001192093,0)
- o18.Position = UDim2.new(1,0,0.20000000298023,0)
- o18.BackgroundColor3 = Color3.new(1, 0, 0)
- o18.BorderSizePixel = 0
- o19.Name = "GunLabel"
- o19.Parent = o17
- o19.Position = UDim2.new(10000000000,0,0,0)
- o19.Text = ""
- o19.Position = UDim2.new(10000000000,0,0,0)
- o19.ZIndex = 3
- o19.Font = Enum.Font.ArialBold
- o19.FontSize = Enum.FontSize.Size14
- o19.TextColor3 = Color3.new(1, 1, 1)
- o19.TextXAlignment = Enum.TextXAlignment.Left
- o20.Name = "AmmoLabel"
- o20.Parent = o17
- o20.Position = UDim2.new(1,0,0,0)
- o20.Text = ""
- o20.Position = UDim2.new(1,0,0,0)
- o20.ZIndex = 3
- o20.Font = Enum.Font.ArialBold
- o20.FontSize = Enum.FontSize.Size14
- o20.TextColor3 = Color3.new(1, 1, 1)
- o20.TextXAlignment = Enum.TextXAlignment.Right
- o21.Name = "Arms"
- o21.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- sp = script.Parent
- Mesh = false -- If true will load BC 2.0 Arm meshes as well.
- Shirt = true -- If true will load the user's shirt to the arms as well
- function onEquipped(mouse)
- local Player = game:GetService("Players").LocalPlayer
- local Cam = game.Workspace.CurrentCamera
- local Arms = Instance.new("Model")
- Arms.Name = "Arms"
- Arms.Parent = Cam
- if Shirt == true then
- local Humanoid = Instance.new("Humanoid")
- Humanoid.MaxHealth = 0
- Humanoid.Health = 0
- Humanoid.Name = ""
- Humanoid.Parent = Arms
- --Packages bro
- for i,v in ipairs(Player.Character:GetChildren()) do
- if v.className == "CharacterMesh" or v.className == "Shirt" then
- baws = v:clone()
- baws.Parent = Arms
- else
- end
- end
- end
- local RightArm = Player.Character:FindFirstChild("Right Arm"):clone()
- RightArm.Name = "Right Arm"
- RightArm.Transparency = 0
- RightArm.CanCollide = false
- RightArm.TopSurface = 0
- RightArm.BottomSurface = 0
- local w = Instance.new("Weld")
- w.Part0 = RightArm
- w.Part1 = Player.Character:FindFirstChild("Right Arm")
- w.C0 = CFrame.new()
- w.C1 = CFrame.new()
- w.Parent = RightArm
- RightArm.Parent = Arms
- local LeftArm = Player.Character:FindFirstChild("Left Arm"):clone()
- LeftArm.Name = "Left Arm"
- LeftArm.Transparency = 1
- LeftArm.CanCollide = false
- LeftArm.TopSurface = 0
- LeftArm.BottomSurface = 0
- local w = Instance.new("Weld")
- w.Part0 = LeftArm
- w.Part1 = Player.Character:FindFirstChild("Left Arm")
- w.C0 = CFrame.new()
- w.C1 = CFrame.new()
- w.Parent = LeftArm
- LeftArm.Parent = Arms
- if Mesh ~= false then
- local LeftArmMesh = script:FindFirstChild("LeftArm")
- LeftArmMesh.Parent = LeftArm
- local RightArmMesh = script:FindFirstChild("RightArm")
- RightArmMesh.Parent = RightArm
- else end
- end
- function onUnequipped(mouse)
- local Player = game:GetService("Players").LocalPlayer
- local Cam = script.Parent
- for _, Model in pairs(game.Workspace.CurrentCamera:GetChildren()) do
- if Model.Name == "Arms" then
- Model:remove()
- else end
- end
- end
- sp.Equipped:connect(onEquipped)
- sp.Unequipped:connect(onUnequipped)
- end,o21)
- end))
- o22.Name = "LeftArm"
- o22.Parent = o21
- o22.MeshId = "http://www.roblox.com/asset/?id=27111419"
- o22.MeshType = Enum.MeshType.FileMesh
- o23.Name = "RightArm"
- o23.Parent = o21
- o23.MeshId = "http://www.roblox.com/asset/?id=27111864"
- o23.MeshType = Enum.MeshType.FileMesh
- o24.Name = "Sidegun"
- o24.Parent = o1
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --made by alextomcool!!!
- --to use: put in type of gun: barrel point left, barrel point right or bull-pup(main hande is in the middle of the gun)
- --step 2: put in what type of wepoan it is: assult rifle or pistol(there will be more)
- --to do list: make it easyer to modife how it weld's.
- guntype = 3--1 is assult rifle, 2 is bullpup, 3 is pistol, 4 is knife
- weldmode = 1--1 is barrel point upper-left, 2 is barrel pointing upper-right, 3 is barrel point lower-left and 4 is barrel point lower-right
- -------(note: if it is pistol or knife then 1 is on right leg, 2 is on left leg, 3 is in the back of your pants and 4 is in the front of your pants)
- model = nil--gun model, that is
- distance = 0.65--this is the distance between the part(torso/leg) and the gun. DON'T MAKE negitive
- rotation = 45--this is the turning in degrees.
- --this area is mode more for someone who's already good at gun's. please do not get mad at me if you don't understand what's under here
- y = 0--this is what's added to the current y value. positive number's make it go down. negative make's it go up
- x = 0--this is what's added to the x value(it's really the z value but it look's like the x value when on your back). positive number's make it go left. negative make's it go right
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------
- --no one should have to edit what's under here. this is for people who know what they are doing(it's still might be hard to edit)--
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------
- parts = {}
- local n = 1
- --can i have my
- function on(mouse)
- if model == nil then
- n = 1
- local m = Instance.new("Model")
- local all = script.Parent:GetChildren()
- for i = 1, #all do
- if all[i].className == "Part" then
- parts[n] = all[i].Transparency
- local brick = all[i]:clone()
- brick.Parent = m
- n = n +1
- end
- end
- wait()
- if model == nil then
- local weld = script:FindFirstChild("Weld2")
- if weld ~= nil then
- local new = weld:clone()
- new.Disabled = false
- new.Parent = m
- m.Name = script.Parent.Name
- m.Parent = script.Parent.Parent
- model = m
- local handle = model:FindFirstChild("Handle")
- if handle ~= nil then
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- if guntype == 1 then
- local torso = model.Parent:FindFirstChild("Torso")
- if torso ~= nil then
- if weldmode == 1 then--barrel pointing upper-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
- elseif weldmode == 2 then--barrel pointing upper-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
- elseif weldmode == 3 then--barrel pointing upside-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), 0)
- elseif weldmode == 4 then--barrel pointing upside-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1, 0)
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- elseif guntype == 2 then--BullPup
- local torso = model.Parent:FindFirstChild("Torso")
- if torso ~= nil then
- if weldmode == 1 then--barrel pointing upper-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25+y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2, 0)
- elseif weldmode == 2 then--barrel pointing upper-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2 *-1, 0)
- elseif weldmode == 3 then--barrel pointing upside-right
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2, 0)
- elseif weldmode == 4 then--barrel pointing upside-left
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2 *-1, 0)
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- elseif guntype == 3 then--pistol
- local lleg = model.Parent:FindFirstChild("Left Leg")
- local rleg = model.Parent:FindFirstChild("Right Leg")
- if lleg ~= nil and rleg ~= nil then
- if weldmode == 1 then--pistol on right leg
- local w = Instance.new("Weld")
- w.Part0 = rleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
- elseif weldmode == 2 then--pistol on left leg
- local w = Instance.new("Weld")
- w.Part0 = lleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
- elseif weldmode == 3 then--knife in pant's back, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2, 0)
- elseif weldmode == 4 then--knife in pant's front, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2 *-1, 0)
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- elseif guntype == 4 then--knife
- local lleg = model.Parent:FindFirstChild("Left Leg")
- local rleg = model.Parent:FindFirstChild("Right Leg")
- local torso = model.Parent:FindFirstChild("Torso")
- if lleg ~= nil and rleg ~= nil and torso ~= nil then
- if weldmode == 1 then--pistol on right leg
- local w = Instance.new("Weld")
- w.Part0 = rleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
- elseif weldmode == 2 then--pistol on left leg
- local w = Instance.new("Weld")
- w.Part0 = lleg
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
- elseif weldmode == 3 then--knife in pant's back, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2, 0)
- elseif weldmode == 4 then--knife in pant's front, gangsta like
- local w = Instance.new("Weld")
- w.Part0 = torso
- w.Parent = w.Part0
- w.Part1 = handle
- w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2 *-1, 0)
- end
- end
- end
- end
- end
- end
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- if model ~= nil then
- n = 1
- local all = model:GetChildren()
- for i = 1, #all do
- if all[i].className == "Part" then
- all[i].Transparency = 1
- end
- end
- end
- end
- --check
- function off(mouse)
- if model ~= nil then
- n = 1
- local all = model:GetChildren()
- for i = 1, #all do
- if all[i].className == "Part" then
- all[i].Transparency = parts[n]
- local Do = true
- if Do then
- Do = false--dude!
- n = n +1
- end
- end
- end
- end
- end
- --please?
- script.Parent.Equipped:connect(on)
- script.Parent.Unequipped:connect(off)
- end,o24)
- end))
- o25.Name = "Weld2"
- o25.Parent = o24
- o25.Disabled = true
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function Weld(x,y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = x
- end
- function Get(A)
- if A.className == "Part" then
- Weld(script.Parent.Handle, A)
- A.Anchored = false
- else
- local C = A:GetChildren()
- for i=1, #C do
- Get(C[i])
- end
- end
- end
- local yes = true
- if yes then
- yes = false
- Get(script.Parent)
- end
- function onDied()
- script.Parent.Parent = nil
- end
- h = script.Parent.Parent:FindFirstChild("Humanoid")
- if h ~= nil then
- h.Died:connect(onDied)
- end
- end,o25)
- end))
- mas.Parent = workspace
- mas:MakeJoints()
- local mas1 = mas:GetChildren()
- for i=1,#mas1 do
- mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
- ypcall(function() mas1[i]:MakeJoints() end)
- end
- mas:Destroy()
- for i=1,#cors do
- coroutine.resume(cors[i])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement