Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function message(text,thetime)
- local msg = Instance.new("Message")
- msg.Text = text
- msg.Parent = workspace
- game:GetService("Debris"):AddItem(msg,thetime)
- end
- local megalovania = Instance.new("Sound")
- megalovania.SoundId = "rbxassetid://304201750"
- megalovania.Looped = true
- megalovania.Parent = game:GetService("SoundService")
- megalovania:Play()
- local tweenservice = game:GetService("TweenService")
- local goal = {}
- goal.Brightness = 0.2
- goal.OutdoorAmbient = Color3.fromRGB(20,20,20)
- goal.GeographicLatitude = 0
- local tweeninfo = TweenInfo.new(12.5)
- local tween = tweenservice:Create(game:GetService("Lighting"), tweeninfo, goal)
- tween:Play()
- wait(13.554)
- game:GetService("Lighting").TimeOfDay = "00:00:00"
- game:GetService("Lighting").Ambient = Color3.fromRGB(255,0,0)
- message("Boss Battle Time!", 1)
- do
- --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"))
- Part0 = Instance.new("Part")
- CylinderMesh1 = Instance.new("CylinderMesh")
- Script2 = Instance.new("Script")
- Part0.Parent = mas
- Part0.Material = Enum.Material.Neon
- Part0.BrickColor = BrickColor.new("Toothpaste")
- Part0.Anchored = true
- Part0.CanCollide = false
- Part0.Size = Vector3.new(10, 255, 10)
- Part0.CFrame = CFrame.new(-1.1920929e-07, 127.5, -5.96046448e-08, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part0.BottomSurface = Enum.SurfaceType.Smooth
- Part0.TopSurface = Enum.SurfaceType.Smooth
- Part0.Color = Color3.new(0, 1, 1)
- Part0.Position = Vector3.new(-1.1920929e-07, 127.5, -5.96046448e-08)
- Part0.Color = Color3.new(0, 1, 1)
- CylinderMesh1.Parent = Part0
- Script2.Parent = Part0
- table.insert(cors,sandbox(Script2,function()
- local TweenService = game:GetService("TweenService")
- local goal = {}
- goal.Size = Vector3.new(50,255,50)
- goal.Transparency = 1
- local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Quad)
- local tween = TweenService:Create(script.Parent, tweenInfo, goal)
- tween:Play()
- wait(10)
- for _,player in pairs(game:GetService("Players"):GetPlayers()) do
- --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")
- Script1 = Instance.new("Script")
- Part2 = Instance.new("Part")
- SpecialMesh3 = Instance.new("SpecialMesh")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Vector3Value6 = Instance.new("Vector3Value")
- IntValue7 = Instance.new("IntValue")
- BoolValue8 = Instance.new("BoolValue")
- IntValue9 = Instance.new("IntValue")
- BoolValue10 = Instance.new("BoolValue")
- Animation11 = Instance.new("Animation")
- BoolValue12 = Instance.new("BoolValue")
- ScreenGui13 = Instance.new("ScreenGui")
- Frame14 = Instance.new("Frame")
- Frame15 = Instance.new("Frame")
- Frame16 = Instance.new("Frame")
- ImageLabel17 = Instance.new("ImageLabel")
- ImageLabel18 = Instance.new("ImageLabel")
- Frame19 = Instance.new("Frame")
- ImageLabel20 = Instance.new("ImageLabel")
- ImageLabel21 = Instance.new("ImageLabel")
- ImageLabel22 = Instance.new("ImageLabel")
- Frame23 = Instance.new("Frame")
- Frame24 = Instance.new("Frame")
- ImageLabel25 = Instance.new("ImageLabel")
- ImageLabel26 = Instance.new("ImageLabel")
- Frame27 = Instance.new("Frame")
- ImageLabel28 = Instance.new("ImageLabel")
- ImageLabel29 = Instance.new("ImageLabel")
- Animation30 = Instance.new("Animation")
- Animation31 = Instance.new("Animation")
- SpecialMesh32 = Instance.new("SpecialMesh")
- LocalScript33 = Instance.new("LocalScript")
- RemoteEvent34 = Instance.new("RemoteEvent")
- RemoteEvent35 = Instance.new("RemoteEvent")
- Script36 = Instance.new("Script")
- Tool0.Name = "Sterling"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=95392509 "
- Tool0.GripForward = Vector3.new(-0.500696421, -0.104253426, -0.859321952)
- Tool0.GripPos = Vector3.new(0.0644919276, -0.358220965, 0.191235617)
- Tool0.GripRight = Vector3.new(0.865328908, -0.0344124958, -0.500021636)
- Tool0.GripUp = Vector3.new(-0.0225575566, 0.993955255, -0.107443735)
- Tool0.ToolTip = "Sten Gun"
- Script1.Name = "Firescript"
- Script1.Parent = Tool0
- table.insert(cors,sandbox(Script1,function()
- -- Made by Stickmasterluke
- -- edited by fusroblox
- local GoreOn=false
- function WaitForChild(parent,child)
- while not parent:FindFirstChild(child) do print("2waiting for " .. child) wait() end
- return parent[child]
- end
- local GLib = require(206209239)
- local GunObject = {
- Tool = script.Parent,
- Handle = WaitForChild(script.Parent,'Handle'),
- check = true,
- GunDamage = 15, -- Base output damage per shot.
- FireRate = .12, -- How often the weapon can fire.
- Automatic = true, -- hold down to continue firing
- Range = 250, -- Max distance that the weapon can fire.
- Spread = 7, -- The bigger the spread, the more inaccurate the shots will be.
- ClipSize = 50, -- Shots in a clip
- ReloadTime = 3, -- Time it takes to reload the tool.
- StartingClips = 10, -- If you want infinit clips, remove the IntValue named "Clips" from the tool.
- SegmentLength = 40, -- How long the shot segments are, or the speed of the shot.
- FadeDelayTime = 1/30,
- BarrelPos = CFrame.new(0, 0, - 1.2), -- L, F, U
- Rate = 1/30,
- --local Colors = {BrickColor.new("Bright red"), BrickColor.new("Really red"), BrickColor.new("Dusty Rose"), BrickColor.new("Medium red")}
- Colors = {BrickColor.new("Bright yellow"),BrickColor.new("Mid gray"), BrickColor.new("Medium stone grey"), BrickColor.new("Dark stone grey")},
- FlashColors = {"Medium red", "Dusty Rose", "Bright red", "Really red"},
- Reloading = false,
- Debris = game:GetService("Debris"),
- Ammo,
- Clips,
- LaserObj,
- SparkEffect,
- ShellPart,
- --tool children
- DownVal=WaitForChild(script.Parent, 'Down'),
- AimVal=WaitForChild(script.Parent, 'Aim'),
- ReloadingVal=WaitForChild(script.Parent, 'Reloading'),
- DoFireAni = WaitForChild(script.Parent,'DoFireAni'),
- --handlechildren
- Fire,
- }
- --[[Member functions]]
- function GunObject:Initialize()
- self.Fire=WaitForChild(self.Handle, 'Fire')
- self.Ammo = self.Tool:FindFirstChild("Ammo")
- if self.Ammo ~= nil then
- self.Ammo.Value = self.ClipSize
- end
- self.Clips = self.Tool:FindFirstChild("Clips")
- if self.Clips ~= nil then
- self.Clips.Value = self.StartingClips
- end
- self.Tool.Equipped:connect(function()
- self.Tool.Handle.Fire:Stop()
- self.Tool.Handle.Reload:Stop()
- end)
- self.Tool.Unequipped:connect(function()
- self.Tool.Handle.Fire:Stop()
- self.Tool.Handle.Reload:Stop()
- end)
- self.LaserObj = Instance.new("Part")
- self.LaserObj.Name = "Bullet"
- self.LaserObj.Anchored = true
- self.LaserObj.CanCollide = false
- self.LaserObj.Shape = "Block"
- self.LaserObj.formFactor = "Custom"
- self.LaserObj.Material = Enum.Material.Plastic
- self.LaserObj.Locked = true
- self.LaserObj.TopSurface = 0
- self.LaserObj.BottomSurface = 0
- local tSparkEffect = Instance.new("Part")
- tSparkEffect.Name = "Effect"
- tSparkEffect.Anchored = false
- tSparkEffect.CanCollide = false
- tSparkEffect.Shape = "Block"
- tSparkEffect.formFactor = "Custom"
- tSparkEffect.Material = Enum.Material.Plastic
- tSparkEffect.Locked = true
- tSparkEffect.TopSurface = 0
- tSparkEffect.BottomSurface = 0
- self.SparkEffect=tSparkEffect
- local tshell = Instance.new('Part')
- tshell.Name='effect'
- tshell.FormFactor='Custom'
- tshell.Size=Vector3.new(1, 0.4, 0.33)
- tshell.BrickColor=BrickColor.new('Bright yellow')
- local tshellmesh=WaitForChild(script.Parent,'BulletMesh'):Clone()
- tshellmesh.Parent=tshell
- self.ShellPart = tshell
- self.DownVal.Changed:connect(function()
- while self.DownVal.Value and self.check and not self.Reloading do
- self.check = false
- local humanoid = self.Tool.Parent:FindFirstChild("Humanoid")
- local plr1 = game.Players:GetPlayerFromCharacter(self.Tool.Parent)
- if humanoid ~= nil and plr1 ~= nil then
- if humanoid.Health > 0 then
- local spos1 = (self.Tool.Handle.CFrame * self.BarrelPos).p
- delay(0, function() self:SendBullet(spos1, self.AimVal.Value, self.Spread, self.SegmentLength, self.Tool.Parent, self.Colors[1], self.GunDamage, self.FadeDelayTime) end)
- else
- self.check = true
- break
- end
- else
- self.check = true
- break
- end
- wait(self.FireRate)
- self.check = true
- if not self.Automatic then
- break
- end
- end
- end)
- self.ReloadingVal.Changed:connect(function() if self.ReloadingVal.Value then self:Reload() end end)
- end
- function GunObject:Reload()
- self.Reloading = true
- self.ReloadingVal.Value = true
- if self.Clips ~= nil then
- if self.Clips.Value > 0 then
- self.Clips.Value = Clips.Value - 1
- else
- self.Reloading = false
- self.ReloadingVal.Value = false
- return
- end
- end
- self.Tool.Handle.Reload:Play()
- for i = 1, self.ClipSize do
- wait(self.ReloadTime/self.ClipSize)
- self.Ammo.Value = i
- end
- self.Reloading = false
- self.Tool.Reloading.Value = false
- end
- function GunObject:SpawnShell()
- local tshell=self.ShellPart:Clone()
- tshell.CFrame=self.Handle.CFrame
- tshell.Parent=Workspace
- game.Debris:AddItem(tshell,2)
- end
- function KnockOffHats(tchar)
- for _,i in pairs(tchar:GetChildren()) do
- if i:IsA('Hat') then
- i.Parent=game.Workspace
- end
- end
- end
- function KnockOffTool(tchar)
- for _,i in pairs(tchar:GetChildren()) do
- if i:IsA('Tool') then
- i.Parent=game.Workspace
- end
- end
- end
- function GunObject:SendBullet(boltstart, targetpos, fuzzyness, SegmentLength, ignore, clr, damage, fadedelay)
- if self.Ammo.Value <=0 then return end
- self.Ammo.Value = self.Ammo.Value - 1
- self:SpawnShell()
- self.Fire.Pitch = (math.random() * .5) + .75
- self.Fire:Play()
- self.DoFireAni.Value = not self.DoFireAni.Value
- print(self.Fire.Pitch)
- local boltdist = self.Range
- local clickdist = (boltstart - targetpos).magnitude
- local targetpos = targetpos + (Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5) * (clickdist/100))
- 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, self.LaserObj)
- if bolthit ~= nil then
- local h = bolthit.Parent:FindFirstChild("Humanoid")
- if h ~= nil then
- local plr = game.Players:GetPlayerFromCharacter(self.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() self:HitEffect(endpos, bolthit,5) end)
- else
- if(hit.Name=='Head') then
- KnockOffHats(hit.Parent)
- end
- if GoreOn then delay(0,function() self:HitEffect(endpos, bolthit,20) end) end
- if not GLib.IsTeammate(GLib.GetPlayerFromPart(script), GLib.GetPlayerFromPart(h)) then
- GLib.TagHumanoid(GLib.GetPlayerFromPart(script), h, 1)
- h:TakeDamage(damage)
- end
- end
- else
- delay(0, function() self:HitEffect(endpos, bolthit,5) end)
- end
- break
- end
- lastpos = endpos
- wait(Rate)
- end
- if self.Ammo.Value < 1 then
- self:Reload()
- end
- end
- function GunObject:MakeSpark(pos,p)
- local effect=self.SparkEffect:Clone()
- effect.BrickColor = p.BrickColor
- effect.Material = p.Material
- effect.Transparency = p.Transparency
- effect.Reflectance = p.Reflectance
- effect.CFrame = CFrame.new(pos)
- effect.Parent = game.Workspace
- 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)/30, math.abs(effectVel.velocity.y)/30, math.abs(effectVel.velocity.z)/30)
- wait()
- effectVel:Destroy()
- local effecttime = .5
- game.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 GunObject:HitEffect(pos,p,numSparks)
- for i = 0, numSparks, 1 do
- Spawn(function() self:MakeSpark(pos,p) end)
- end
- end
- --[[/Member functions]]
- --[[Static functions]]
- function Round(number, decimal)
- decimal = decimal or 0
- local mult = 10^decimal
- return math.floor(number * mult + .5)/mult
- end
- function SigNum(num)
- if num == 0 then return 1 end
- return math.abs(num)/num
- end
- --this is a little bad, but shouldn't really be part of the 'class' of the gun
- local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,}
- function CheckIntangible(hitObj)
- print(hitObj.Name)
- return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1
- 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 DrawBeam(beamstart, beamend, clr, fadedelay, templatePart)
- local dis = 2 --(beamstart - beamend).magnitude
- local tlaser=templatePart:Clone()
- tlaser.BrickColor = clr
- tlaser.Size = Vector3.new(.1, .1, dis + .2)
- tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2)
- tlaser.Parent = game.Workspace
- game.Debris:AddItem(tlaser, fadedelay)
- end
- --[[/Static functions]]
- GunObject:Initialize()
- end))
- Part2.Name = "Handle"
- Part2.Parent = Tool0
- Part2.Material = Enum.Material.Metal
- Part2.BrickColor = BrickColor.new("Bright bluish green")
- Part2.Rotation = Vector3.new(153.399994, -9.92000008, 165.619995)
- Part2.Locked = true
- Part2.FormFactor = Enum.FormFactor.Custom
- Part2.Size = Vector3.new(0.770000994, 0.930003285, 3.75999236)
- Part2.CFrame = CFrame.new(0.00223900075, 0.528563023, 0.0107610002, -0.954190433, -0.244642586, -0.172256544, -0.14737393, 0.885324776, -0.441000909, 0.260390431, -0.395412296, -0.880821228)
- Part2.Color = Color3.new(0, 0.560784, 0.611765)
- Part2.Position = Vector3.new(0.00223900075, 0.528563023, 0.0107610002)
- Part2.Orientation = Vector3.new(26.1700001, -168.929993, -9.44999981)
- Part2.Color = Color3.new(0, 0.560784, 0.611765)
- SpecialMesh3.Parent = Part2
- SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=95388062"
- SpecialMesh3.Scale = Vector3.new(0.5, 0.5, 0.5)
- SpecialMesh3.TextureId = "http://www.roblox.com/asset/?id=95391833"
- SpecialMesh3.MeshType = Enum.MeshType.FileMesh
- SpecialMesh3.Scale = Vector3.new(0.5, 0.5, 0.5)
- Sound4.Name = "Fire"
- Sound4.Parent = Part2
- Sound4.Pitch = 0.82116913795471
- Sound4.SoundId = "http://www.roblox.com/asset/?id=95315676"
- Sound4.Volume = 1
- Sound5.Name = "Reload"
- Sound5.Parent = Part2
- Sound5.SoundId = "http://www.roblox.com/asset/?id=95309699"
- Sound5.Volume = 1
- Vector3Value6.Name = "Aim"
- Vector3Value6.Parent = Tool0
- Vector3Value6.Value = Vector3.new(7370.47461, -428.252258, -6819.59961)
- IntValue7.Name = "Ammo"
- IntValue7.Parent = Tool0
- IntValue7.Value = 25
- BoolValue8.Name = "Down"
- BoolValue8.Parent = Tool0
- IntValue9.Name = "NoClips"
- IntValue9.Parent = Tool0
- BoolValue10.Name = "Reloading"
- BoolValue10.Parent = Tool0
- Animation11.Name = "FireAni"
- Animation11.Parent = Tool0
- Animation11.AnimationId = "http://www.roblox.com/Asset?ID=95390146"
- BoolValue12.Name = "DoFireAni"
- BoolValue12.Parent = Tool0
- ScreenGui13.Name = "AmmoHud"
- ScreenGui13.Parent = Tool0
- Frame14.Name = "Bar"
- Frame14.Parent = ScreenGui13
- Frame14.Transparency = 1
- Frame14.Size = UDim2.new(0, 200, 0, 60)
- Frame14.Position = UDim2.new(1, -200, 1, -170)
- Frame14.BackgroundTransparency = 1
- Frame14.ClipsDescendants = true
- Frame15.Name = "AmmoLeft"
- Frame15.Parent = Frame14
- Frame15.Transparency = 1
- Frame15.Size = UDim2.new(0, 65, 0, 50)
- Frame15.Position = UDim2.new(0, 10, 0, 5)
- Frame15.BackgroundTransparency = 1
- Frame16.Name = "1"
- Frame16.Parent = Frame15
- Frame16.Transparency = 1
- Frame16.Size = UDim2.new(0, 30, 0, 40)
- Frame16.BackgroundTransparency = 1
- ImageLabel17.Parent = Frame16
- ImageLabel17.Transparency = 1
- ImageLabel17.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel17.BackgroundTransparency = 1
- ImageLabel17.ZIndex = 2
- ImageLabel17.Image = "http://www.roblox.com/asset/?id=94130434"
- ImageLabel18.Name = "digit"
- ImageLabel18.Parent = Frame16
- ImageLabel18.Transparency = 1
- ImageLabel18.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
- ImageLabel18.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
- ImageLabel18.BackgroundTransparency = 1
- ImageLabel18.ZIndex = 2
- ImageLabel18.Image = "http://www.roblox.com/asset/?id=94099941"
- Frame19.Name = "2"
- Frame19.Parent = Frame15
- Frame19.Transparency = 1
- Frame19.Size = UDim2.new(0, 30, 0, 40)
- Frame19.Position = UDim2.new(1, -30, 0, 0)
- Frame19.BackgroundTransparency = 1
- ImageLabel20.Parent = Frame19
- ImageLabel20.Transparency = 1
- ImageLabel20.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel20.BackgroundTransparency = 1
- ImageLabel20.ZIndex = 2
- ImageLabel20.Image = "http://www.roblox.com/asset/?id=94130434"
- ImageLabel21.Name = "digit"
- ImageLabel21.Parent = Frame19
- ImageLabel21.Transparency = 1
- ImageLabel21.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
- ImageLabel21.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
- ImageLabel21.BackgroundTransparency = 1
- ImageLabel21.ZIndex = 2
- ImageLabel21.Image = "http://www.roblox.com/asset/?id=94099941"
- ImageLabel22.Name = "slash"
- ImageLabel22.Parent = Frame14
- ImageLabel22.Transparency = 1
- ImageLabel22.Size = UDim2.new(0, 30, 0, 40)
- ImageLabel22.Position = UDim2.new(0.5, -20, 0, 5)
- ImageLabel22.BackgroundTransparency = 1
- ImageLabel22.ZIndex = 2
- ImageLabel22.Image = "http://www.roblox.com/asset/?id=94100300"
- Frame23.Name = "TotalAmmo"
- Frame23.Parent = Frame14
- Frame23.Transparency = 1
- Frame23.Size = UDim2.new(0, 65, 0, 50)
- Frame23.Position = UDim2.new(0.5, 10, 0, 5)
- Frame23.BackgroundTransparency = 1
- Frame24.Name = "1"
- Frame24.Parent = Frame23
- Frame24.Transparency = 1
- Frame24.Size = UDim2.new(0, 30, 0, 40)
- Frame24.BackgroundTransparency = 1
- Frame24.ClipsDescendants = true
- ImageLabel25.Parent = Frame24
- ImageLabel25.Transparency = 1
- ImageLabel25.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel25.BackgroundTransparency = 1
- ImageLabel25.ZIndex = 2
- ImageLabel25.Image = "http://www.roblox.com/asset/?id=94130434"
- ImageLabel26.Name = "digit"
- ImageLabel26.Parent = Frame24
- ImageLabel26.Transparency = 1
- ImageLabel26.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
- ImageLabel26.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
- ImageLabel26.BackgroundTransparency = 1
- ImageLabel26.ZIndex = 2
- ImageLabel26.Image = "http://www.roblox.com/asset/?id=94099941"
- Frame27.Name = "2"
- Frame27.Parent = Frame23
- Frame27.Transparency = 1
- Frame27.Size = UDim2.new(0, 30, 0, 40)
- Frame27.Position = UDim2.new(1, -30, 0, 0)
- Frame27.BackgroundTransparency = 1
- ImageLabel28.Parent = Frame27
- ImageLabel28.Transparency = 1
- ImageLabel28.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel28.BackgroundTransparency = 1
- ImageLabel28.ZIndex = 2
- ImageLabel28.Image = "http://www.roblox.com/asset/?id=94130434"
- ImageLabel29.Name = "digit"
- ImageLabel29.Parent = Frame27
- ImageLabel29.Transparency = 1
- ImageLabel29.Size = UDim2.new(0.899999976, 0, 0.899999976, 0)
- ImageLabel29.Position = UDim2.new(0.0500000007, 0, 0.0500000007, 0)
- ImageLabel29.BackgroundTransparency = 1
- ImageLabel29.ZIndex = 2
- ImageLabel29.Image = "http://www.roblox.com/asset/?id=94099941"
- Animation30.Name = "idle"
- Animation30.Parent = Tool0
- Animation30.AnimationId = "http://www.roblox.com/Asset?ID=95389685"
- Animation31.Name = "Reload"
- Animation31.Parent = Tool0
- Animation31.AnimationId = "http://www.roblox.com/Asset?ID=95390631"
- SpecialMesh32.Name = "BulletMesh"
- SpecialMesh32.Parent = Tool0
- SpecialMesh32.MeshId = "http://www.roblox.com/asset/?id=95392019"
- SpecialMesh32.Scale = Vector3.new(1.5, 1.5, 1.5)
- SpecialMesh32.TextureId = "http://www.roblox.com/asset/?id=95391833"
- SpecialMesh32.MeshType = Enum.MeshType.FileMesh
- SpecialMesh32.Scale = Vector3.new(1.5, 1.5, 1.5)
- LocalScript33.Parent = Tool0
- table.insert(cors,sandbox(LocalScript33,function()
- local equipped = false
- local setIconCon
- local Players = game:GetService'Players'
- local reloadCounter = 0
- Cursors = {
- "http://www.roblox.com/asset/?id=94154683", -- black
- "http://www.roblox.com/asset/?id= 94154829", -- red
- "http://www.roblox.com/asset/?id=94155503",
- "http://www.roblox.com/asset/?id=94155569"
- }
- local getCharacterFromPart = function(part)
- local current = part
- local character = nil
- local humanoid = nil
- while true do
- for i, child in next, current:GetChildren() do
- if child:IsA'Humanoid' then
- character = current
- humanoid = child
- break
- end
- end
- if character then
- break
- else
- current = current.Parent
- if not current or current == game then
- break
- end
- end
- end
- return character, character and Players:GetPlayerFromCharacter(character), humanoid
- end
- script.Parent.Equipped:connect(function(mouse)
- equipped = true
- mouse.Button1Down:connect(function() script.Parent.Input:FireServer('Mouse1', true, mouse.Hit.p, mouse.Target) end)
- mouse.Button1Up:connect(function() script.Parent.Input:FireServer('Mouse1', false, mouse.Hit.p) end)
- mouse.KeyDown:connect(function(key) script.Parent.Input:FireServer('Key', true, key) end)
- mouse.KeyUp:connect(function(key) script.Parent.Input:FireServer('Key', false, key) end)
- setIconCon = script.Parent.SetIcon.OnClientEvent:connect(function(icon)
- mouse.Icon = icon
- end)
- spawn(function()
- local reloadCounter = 0
- while equipped do
- if script.Parent.Reloading.Value then
- reloadCounter=reloadCounter+1
- if reloadCounter%20<10 then
- mouse.Icon = Cursors[3]
- else
- mouse.Icon = Cursors[4]
- end
- elseif mouse.Target and getCharacterFromPart(mouse.Target) then
- mouse.Icon = Cursors[2]
- else
- mouse.Icon = Cursors[1]
- end
- game:GetService'RunService'.RenderStepped:wait()
- end
- end)
- CAS,UIS = game:GetService'ContextActionService',game:GetService'UserInputService'
- if UIS.TouchEnabled then
- CAS:BindActionToInputTypes(
- 'Sterling_Reload',
- function()
- script.Parent.Input:FireServer('Key', true, 'r')
- end,
- true,
- ''
- )
- CAS:SetTitle('Sterling_Reload', 'Reload')
- end
- while equipped do
- script.Parent.Input:FireServer('MouseMove', mouse.Hit.p, mouse.Target)
- wait(1/20)
- end
- end)
- script.Parent.Unequipped:connect(function()
- equipped = false
- if setIconCon then setIconCon:disconnect() end
- if CAS then CAS:UnbindAction('Sterling_Reload') end
- end)
- end))
- RemoteEvent34.Name = "Input"
- RemoteEvent34.Parent = Tool0
- RemoteEvent35.Name = "SetIcon"
- RemoteEvent35.Parent = Tool0
- Script36.Parent = Tool0
- table.insert(cors,sandbox(Script36,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 function FindCharacterAncestor(subject)
- if subject and subject ~= Workspace then
- if subject:FindFirstChild('Humanoid') then
- return subject
- else
- return FindCharacterAncestor(subject.Parent)
- end
- end
- return nil
- end
- local Tool = script.Parent
- local GunObj ={
- Reloading = "http://www.roblox.com/asset/?id=94155503",
- Cursors = {
- "http://www.roblox.com/asset/?id=94154683", -- black
- "http://www.roblox.com/asset/?id= 94154829", -- red
- "http://www.roblox.com/asset/?id=94155503",
- "http://www.roblox.com/asset/?id=94155569"
- },
- ClipSize = 50,
- Equipped = false,
- Ammo = WaitForChild(script.Parent,"Ammo"),
- Clips,
- Gui = WaitForChild(Tool,"AmmoHud"),
- NumberImages={},
- IdleAni,
- MyMouse
- }
- local ChestWeld
- Tool.Equipped:connect(function(mouse) GunObj:OnEquipped(mouse) end)
- local initialized=false
- function GunObj:Initialize()
- if initialized then return end
- initialized=true
- self.Ammo.Changed:connect(function()self:UpdateGui()end)
- WaitForChild(Tool, "Reloading")
- print('got to connections!!!!! ')
- Tool.Reloading.Changed:connect(function() self:UpdateGui() end)
- Tool.Unequipped:connect(function() self:OnUnequipped() end)
- Tool.DoFireAni.Changed:connect(PlayFireAni)
- self.NumberImages['0']=94128401
- self.NumberImages['1']=94128421
- self.NumberImages['2']=94128434
- self.NumberImages['3']=94128446
- self.NumberImages['4']=94128466
- self.NumberImages['5']=94128485
- self.NumberImages['6']=94128496
- self.NumberImages['7']=94128523
- self.NumberImages['8']=94128538
- self.NumberImages['9']=94128538
- local bar=WaitForChild(self.Gui,'Bar')
- self:UpdateNumbers(self.ClipSize..'', WaitForChild(bar,'TotalAmmo'))
- end
- function GunObj:UpdateNumbers(data,frame)
- if string.len(data)==0 then
- data= '0'..data
- end
- if string.len(data)==1 then
- data= '0'..data
- end
- local digit=WaitForChild(WaitForChild(frame,'1'),'digit')
- if digit.Image ~='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,1,1)] then
- local ndigit=digit:Clone()
- ndigit.Position=UDim2.new(ndigit.Position.X.Scale,ndigit.Position.X.Offset,ndigit.Position.Y.Scale,ndigit.Position.Y.Offset-65)
- ndigit.Image='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,1,1)]
- ndigit.Parent=digit.Parent
- ndigit:TweenPosition(digit.Position, "Out", "Quad", .1,true)
- digit.Name='oldDigit'
- digit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,
- digit.Parent.Position.Y.Offset+95), "Out", "Quad", .25,true)
- game.Debris:AddItem(digit,1)
- end
- digit=WaitForChild(WaitForChild(frame,'2'),'digit')
- if digit.Image ~='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,2,2)] then
- ndigit=digit:Clone()
- ndigit.Position=UDim2.new(ndigit.Position.X.Scale,ndigit.Position.X.Offset,ndigit.Position.Y.Scale,ndigit.Position.Y.Offset-65)
- ndigit.Image='http://www.roblox.com/asset/?id='..self.NumberImages[string.sub(data,2,2)]
- ndigit.Parent=digit.Parent
- ndigit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,0), "Out", "Quad", .25,true)
- digit.Name='oldDigit'
- digit:TweenPosition(UDim2.new(digit.Position.X.Scale,digit.Position.X.Offset,digit.Position.Y.Scale,
- digit.Parent.Position.Y.Offset+95), "Out", "Quad", .25,true)
- game.Debris:AddItem(digit,1)
- end
- end
- function GunObj:UpdateGui()
- if self.Equipped then
- local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
- if Player ~= nil then
- if self.Ammo == nil then
- --self.Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"
- --self.Gui.Bar.AmmoLabel.Text = ""
- else
- --self.Gui.Bar.GunLabel.Text ="Futuro Heavy Pistol"
- --self.Gui.Bar.AmmoLabel.Text = tostring(self.Ammo.Value).."/"..tostring(self.ClipSize)
- self:UpdateNumbers(tostring(self.Ammo.Value),WaitForChild(self.Gui.Bar,'AmmoLeft'))
- end
- if Tool.Reloading.Value then
- --self.Gui.Bar.AmmoLabel.Text = "Reloading"
- end
- end
- end
- end
- function GunObj:CursorUpdate(mouse)
- local reloadCounter=0
- end
- local InReload=false
- script.Parent.Input.OnServerEvent:connect(function(client, action, ...)
- if client.Character == script.Parent.Parent then
- if action == 'Mouse1' then
- local down, pos = ...
- if down then
- if not Tool.Down.Value then
- Tool.Aim.Value = pos
- Tool.Down.Value = true
- end
- else
- Tool.Down.Value = false
- end
- elseif action == 'Key' then
- local down, key = ...
- if down then
- if key=='r' and not Tool.Reloading.Value and not Tool.Down.Value and GunObj.Ammo.Value ~=8 and GunObj.Ammo.Value ~=0 and not InReload then
- Tool.Reloading.Value=true
- end
- end
- elseif action == 'MouseMove' then
- local pos = ...
- Tool.Aim.Value = pos
- end
- end
- end)
- function GunObj:OnEquipped()
- self:Initialize()
- self.Equipped = true
- local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
- if Player ~= nil then
- local humanoid=WaitForChild(Player.Character,'Humanoid')
- if not self.IdleAni then
- self.IdleAni = humanoid:LoadAnimation(WaitForChild(script.Parent,'idle'))
- self.IdleAni:Play()
- end
- local plrgui = WaitForChild(Player,"PlayerGui")
- self.Gui.Parent = plrgui
- --mouse.Icon = self.Cursors[1]
- Tool.Reloading.Changed:connect(function(val)
- if self.Equipped then
- if val then
- --mouse.Icon = self.Cursors.Reloading
- else
- --mouse.Icon = self.Cursors[1]
- end
- local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
- if Player ~= nil then
- local gui = WaitForChild(Player.PlayerGui, "AmmoHud")
- local humanoid=WaitForChild(Player.Character,'Humanoid')
- self:UpdateGui()
- if Tool.Reloading.Value then
- --gui.Bar.AmmoLabel.Text = "Reloading"
- end
- end
- end
- end)
- self:UpdateGui()
- MyMouse=mouse
- Spawn(function() self:CursorUpdate() end )
- end
- end
- function GunObj:OnUnequipped()
- if self.IdleAni then
- self.IdleAni:Stop()
- self.IdleAni:Destroy()
- self.IdleAni=nil
- end
- self.Gui.Parent = Tool
- self.Equipped = false
- print('in unequipp')
- if ChestWeld then
- print('chestweldexists')
- ChestWeld:Destroy()
- end
- local Player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
- if Player ~= nil then
- local gui = WaitForChild(Player.PlayerGui,"AmmoHud")
- --gui.Bar.GunLabel.Text = ""
- --gui.Bar.AmmoLabel.Text = ""
- end
- end
- function PlayFireAni()
- wait(.1)
- local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.FireAni)
- aniTrack:Play(0,1,1.2)
- end
- local function weldBetween(a, b)
- local weld = Instance.new("Weld")
- weld.Part0 = a
- weld.Part1 = b
- weld.C0 = CFrame.new()
- weld.C1 = b.CFrame:inverse() * a.CFrame
- weld.Parent = a
- return weld;
- end
- function PlayReloadAni()
- InReload=true
- local aniTrack = WaitForChild(Tool.Parent,"Humanoid"):LoadAnimation(Tool.Reload)
- local torso=WaitForChild(Tool.Parent,'Torso')
- local oldWeld
- for _,i in pairs(WaitForChild(Tool.Parent,'Right Arm'):GetChildren()) do
- if i:IsA('Weld') and i.Part1==Tool.Handle then
- oldWeld=i
- end
- end
- if not oldWeld then
- print('What... no old weld!')
- return
- end
- ChestWeld= weldBetween(torso,Tool.Handle)
- oldWeld.Part1=nil
- aniTrack:Play(0,1,1)
- wait(4)
- oldWeld.Part1=Tool.Handle
- ChestWeld:Destroy()
- ChestWeld=nil
- InReload=false
- end
- Tool.Reloading.Changed:connect(function() if Tool.Reloading.Value then PlayReloadAni() end end)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = player.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- end
- --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"))
- Model0 = Instance.new("Model")
- Humanoid1 = Instance.new("Humanoid")
- Part2 = Instance.new("Part")
- SpecialMesh3 = Instance.new("SpecialMesh")
- Script4 = Instance.new("Script")
- Model0.Name = "God Himself"
- Model0.Parent = mas
- Humanoid1.Parent = Model0
- Part2.Name = "Head"
- Part2.Parent = Model0
- Part2.Size = Vector3.new(6, 11, 14)
- Part2.CFrame = CFrame.new(0, 249.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Position = Vector3.new(0, 249.5, 0)
- SpecialMesh3.Parent = Part2
- SpecialMesh3.MeshId = "rbxassetid://891312072"
- SpecialMesh3.TextureId = "rbxassetid://891312078"
- SpecialMesh3.MeshType = Enum.MeshType.FileMesh
- Script4.Parent = Part2
- table.insert(cors,sandbox(Script4,function()
- script.Parent.Touched:connect(function(p)
- local h = p.Parent:FindFirstChild("Humanoid")
- if h ~= nil then
- while p.Parent:FindFirstChild("Humanoid") ~= nil do
- h.Health = 0
- wait(0.5)
- local explosion = Instance.new("Explosion")
- explosion.Position = p.Parent.Head.Position
- explosion.Parent = workspace
- wait(0.5)
- end
- end
- end)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement