Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lp=game:service'Players'.LocalPlayer
- local plr = lp
- local player = lp
- local chr = lp.Character
- local char = chr
- local pr=z1
- local humanoid = char:WaitForChild("Humanoid")
- local db=false
- BodyParts = {
- [1] = "Head";
- [2] = "Left Arm";
- [3] = "Right Arm";
- [4] = "Left Leg";
- [5] = "Right Leg";
- [6] = "Torso";
- }
- headshots = {208341701, 142347633, 146457047,146594648,153622804,176393385,207764796}
- Services = {
- game:service'Players';
- game:service'Workspace';
- game:service'Lighting';
- game:service'ServerStorage';
- ['Run'] = game:service'RunService';
- }
- function PlaySound(id, pitch, parent, volume)
- if volume == nil then volume=tonumber(1) end
- epicsound = Instance.new("Sound")
- epicsound.Name = "Epicosound"
- epicsound.SoundId = "rbxassetid://"..id
- epicsound.Volume = volume
- epicsound.Pitch = pitch
- epicsound.Looped = false
- epicsound.Parent = parent
- sbu = epicsound:Clone()
- sbu.Parent = Storage
- if epicsound.SoundId=="rbxassetid://tt" then -- TELL ME, TELL ME, WHERE DA FREAKS AT!
- epicsound.SoundId="rbxassetid://181158033"
- elseif epicsound.SoundId=="rbxassetid://fabulous" then -- FA-FA-FABULOUS!
- epicsound.SoundId="rbxassetid://191819419"
- elseif epicsound.SoundId=="rbxassetid://ufdb" then -- ultimate final death battle(fairy tail XD)
- epicsound.SoundId="rbxassetid://153085393"
- elseif epicsound.SoundId=="rbxassetid://nnm" then
- epicsound.SoundId="rbxassetid://210189234"
- elseif epicsound.SoundId=="rbxassetid://tun" then -- tunak tunak tun
- epicsound.SoundId="rbxass/setid://162682002"
- elseif epicsound.SoundId=="rbxassetid://zelda" then
- epicsound.SoundId="rbxassetid://158215156"
- elseif epicsound.SoundId=="rbxassetid://cc" then
- epicsound.SoundId="rbxassetid://177080835"
- end
- wait()
- epicsound:Play()
- game:service'Debris':AddItem(epicsound, 8)
- end
- headshoot = function(part)
- local shot=math.random(1, #headshots)
- PlaySound(headshots[shot], .9, part)
- end
- local Run = Services['Run']
- local head = chr[BodyParts[1]]
- local larm = chr[BodyParts[2]]
- local rarm = chr[BodyParts[3]]
- local lleg = chr[BodyParts[4]]
- local rleg = chr[BodyParts[5]]
- local trso = chr[BodyParts[6]]
- local ls = trso['Left Shoulder']
- local rs = trso['Right Shoulder']
- local mouse = plr:GetMouse()
- local attacking = false
- local attack = 0
- local weld = function(p0, p1,x,y,z,ax,ay,az)
- p0.Position = p1.Position
- local w=Instance.new("Motor", p0)
- w.Part0=p0
- w.Part1=p1
- w.C0=CFrame.new(x,y,z)*CFrame.Angles(ax,ay,az)
- end
- mouse = lp:GetMouse()
- function TakeDamage(hum, damage)
- hum:TakeDamage(damage)
- end
- function lerp(a,b,c)return a+(b-a)*c end
- function lerp2(a,b,c)return a*(1-c)+b*c end
- function clerp(c1,c2,al,x)
- local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
- for i,v in pairs(com1) do if x == true then com1[i] = lerp2(v,com2[i],al) else com1[i] = lerp(v,com2[i],al)end end
- return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
- end
- local z1=Instance.new("Part", rarm)
- z1.FormFactor = "Custom"
- z1.Size = Vector3.new(1, 1, 2)
- z1.Locked = true
- z1.CanCollide = false
- z1.TopSurface = 0
- z1.BottomSurface = 0
- z1.FormFactor = 3
- local z2=Instance.new("Part", larm)
- z2.FormFactor = "Custom"
- z2.Size = Vector3.new(1, 1, 2)
- z2.Locked = true
- z2.CanCollide = false
- z2.TopSurface = 0
- z2.BottomSurface = 0
- z2.FormFactor = 3
- local MaxDamage = 144
- local MinDamage = 5
- local Ammo=250
- local Clip=500
- local MaxAmmo=250
- weld(z1,rarm,0,0.7,-0.9,4.7,0,0)
- weld(z2,larm,0,0.7,-0.9,4.7,0,0)
- local g1 = Instance.new("ScreenGui", lp.PlayerGui)
- g1.Name = "AmmoGui"
- local o1 = Instance.new("TextLabel", g1)
- o1.BackgroundColor3 = Color3.new(0.368627, 0.0745098, 1)
- o1.BackgroundTransparency = 0.69999998807907
- o1.BorderColor3 = Color3.new(0.498039, 1, 0.027451)
- o1.BorderSizePixel = 3
- o1.Name = "Ammo"
- o1.Size = UDim2.new(0, 200, 0, 50)
- o1.Text = "Ammo: "..Ammo..'/'..MaxAmmo
- o1.TextWrapped = true
- o1.TextColor3 = Color3.new(0.282353, 0, 1)
- o1.TextStrokeColor3 = Color3.new(0.0666667, 1, 0)
- o1.TextStrokeTransparency = 0.30000001192093
- o1.Font = Enum.Font.ArialBold
- o1.FontSize = Enum.FontSize.Size36
- local o2 = Instance.new("TextLabel", g1)
- o2.BackgroundColor3 = Color3.new(0.368627, 0.0745098, 1)
- o2.BackgroundTransparency = 0.69999998807907
- o2.BorderColor3 = Color3.new(0.498039, 1, 0.027451)
- o2.BorderSizePixel = 3
- o2.Name = "Ammo"
- o2.Size = UDim2.new(0, 200, 0, 50)
- o2.Position=UDim2.new(0, 200, 0, 0)
- o2.Text = "Clip: "..Clip
- o2.TextWrapped = true
- o2.TextColor3 = Color3.new(0.282353, 0, 1)
- o2.TextStrokeColor3 = Color3.new(0.0666667, 1, 0)
- o2.TextStrokeTransparency = 0.30000001192093
- o2.Font = Enum.Font.ArialBold
- o2.FontSize = Enum.FontSize.Size36
- function makeAmmoGui()
- g1 = Instance.new("ScreenGui", lp.PlayerGui)
- g1.Name = "AmmoGui"
- o1 = Instance.new("TextLabel", g1)
- o1.BackgroundColor3 = Color3.new(0.368627, 0.0745098, 1)
- o1.BackgroundTransparency = 0.69999998807907
- o1.BorderColor3 = Color3.new(0.498039, 1, 0.027451)
- o1.BorderSizePixel = 3
- o1.Name = "Ammo"
- o1.Size = UDim2.new(0, 200, 0, 50)
- o1.Text = "Ammo: "..Ammo..'/'..MaxAmmo
- o1.TextWrapped = true
- o1.TextColor3 = Color3.new(0.282353, 0, 1)
- o1.TextStrokeColor3 = Color3.new(0.0666667, 1, 0)
- o1.TextStrokeTransparency = 0.30000001192093
- o1.Font = Enum.Font.ArialBold
- o1.FontSize = Enum.FontSize.Size36
- o2 = Instance.new("TextLabel", g1)
- o2.BackgroundColor3 = Color3.new(0.368627, 0.0745098, 1)
- o2.BackgroundTransparency = 0.69999998807907
- o2.BorderColor3 = Color3.new(0.498039, 1, 0.027451)
- o2.BorderSizePixel = 3
- o2.Name = "Ammo"
- o2.Size = UDim2.new(0, 200, 0, 50)
- o2.Position=UDim2.new(0, 200, 0, 0)
- o2.Text = "Clip: "..Clip
- o2.TextWrapped = true
- o2.TextColor3 = Color3.new(0.282353, 0, 1)
- o2.TextStrokeColor3 = Color3.new(0.0666667, 1, 0)
- o2.TextStrokeTransparency = 0.30000001192093
- o2.Font = Enum.Font.ArialBold
- o2.FontSize = Enum.FontSize.Size36
- end
- function Part(Par, Anc, Colli, Tran, Ref, Col, Siz)
- local p = Instance.new("Part")
- p.formFactor = "Custom"
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Transparency = Tran
- p.Reflectance = Ref
- p.Anchored = Anc
- p.CanCollide = Colli
- p.BrickColor = Col
- p.Size = Siz
- p.Locked = true
- p.Parent = Par
- p:BreakJoints()
- return p
- end
- function Notime(func)
- coroutine.resume(coroutine.create(function()
- func()
- end))
- end
- function Show_Damage(P, D, Area)
- local mo = Instance.new("Model")
- mo.Name = D
- local p = Part(mo, true, false, 0, 0, BrickColor.new("Bright red"), Vector3.new(0.2, 0.2, 0.2))
- p.Name = "Head"
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Scale = Vector3.new(3.5, 2.3, 3.5)
- m.Parent = p
- local h = Instance.new("Humanoid")
- h.Health = 0
- h.MaxHealth = 0
- h.Name = "asd"
- h.Parent = mo
- local nah = true
- mo.Parent = workspace
- local cf = CFrame.new(P) * CFrame.new(math.random(-Area*100, Area*100)/100, math.random(-Area*100, Area*100)/100, math.random(-Area*100, Area*100)/100)
- p.CFrame = cf
- Notime(function()
- Notime(function()
- for i = 0, 6, 0.03 do
- wait()
- p.CFrame = cf * CFrame.new(0, i, 0)
- end
- end)
- wait(1.5)
- for i = 0, 1, 0.05 do
- p.Transparency = i
- if nah then mo.Name = "" nah = false else mo.Name = "- "..D nah = true end
- wait()
- end
- mo:remove()
- end)
- end
- mouse.Button1Down:connect(function()
- if db == false then
- if Ammo > 0 then
- Ammo = Ammo -1
- if pr == z1 then
- pr = z2
- else
- pr = z1
- end
- local cf = CFrame.new((pr.Position + mouse.Hit.p) / 2, mouse.Hit.p)
- local mag = (chr.Torso.Position - mouse.Hit.p).magnitude
- if (mag > 2048) then return end
- PlaySound(213603013, 1, pr, .3)
- local r = Instance.new("Part")
- r.BrickColor = BrickColor.Yellow()
- r.formFactor = "Custom"
- r.Transparency=.7
- r.Size = Vector3.new(0.2,0.2,mag)
- r.CFrame = cf
- r.Anchored = true
- r.CanCollide = false
- r.Parent = chr
- game:service'Debris':AddItem(r, .5)
- o1.Text = "Ammo: "..Ammo..'/'..MaxAmmo
- print(mouse.Target.Name)
- if mouse.Target.Parent:FindFirstChild('Humanoid') then
- if mouse.Target.Name == 'Head' or mouse.Target.Name == 'Handle' then
- Show_Damage(mouse.Target.Parent:FindFirstChild('Head').Position, 'HEADSHOT', 2)
- headshoot(mouse.Target.Parent:FindFirstChild('Torso'))
- print('Damage done: Headshot! (100)')
- mouse.Target.Parent:FindFirstChild('Head'):Destroy''
- elseif mouse.Target.Name == 'Left Leg' or mouse.Target.Name == 'Right Leg' then
- if mouse.Target.Parent:FindFirstChild('Humanoid') then
- local hum=mouse.Target.Parent:FindFirstChild('Humanoid')
- if hum then
- hum.Jump=true
- wait(.2)
- hum.PlatformStand=true
- end
- end
- else
- if mouse.Target.Parent:FindFirstChild('Humanoid') then
- local dmg=math.random(MinDamage, MaxDamage)
- mouse.Target.Parent:FindFirstChild('Humanoid').Health = mouse.Target.Parent:FindFirstChild('Humanoid').Health - dmg
- print('Damage done: '..dmg)
- Show_Damage(mouse.Target.Parent:FindFirstChild('Head').Position, dmg, 1.5)
- end
- end
- end
- else
- PlaySound(132464034, 1, pr, .2)
- print'No ammo!'
- end
- end
- end)
- mouse.KeyDown:connect(function(k)
- if k == 'r' then
- if Ammo < MaxAmmo then
- if Clip > 0 then
- PlaySound(138084889, 1, pr)
- if Clip >= MaxAmmo then
- local rload=MaxAmmo - Ammo
- Clip = Clip - rload
- Ammo = Ammo + rload
- print'reloaded!'
- o1.Text = "Ammo: "..Ammo..'/'..MaxAmmo
- o2.Text = "Clip: "..Clip
- elseif Clip <= MaxAmmo then
- local rload=Clip - Ammo
- if Ammo < rload then
- Ammo = rload
- else
- Ammo = Ammo - rload
- end
- o1.Text = "Ammo: "..Ammo..'/'..MaxAmmo
- o2.Text = "Clip: "..Clip
- end
- else
- print'No clip!'
- end
- end
- elseif k == string.char(48) then
- if chr:FindFirstChild('Humanoid') then
- chr:FindFirstChild('Humanoid').WalkSpeed = chr:FindFirstChild('Humanoid').WalkSpeed + 16
- end
- end
- end)
- mouse.KeyUp:connect(function(k)
- if k == string.char(48) then
- if chr:FindFirstChild('Humanoid') then
- chr:FindFirstChild('Humanoid').WalkSpeed = chr:FindFirstChild('Humanoid').WalkSpeed - 16
- end
- end
- end)
- lp.PlayerGui.DescendantRemoving:connect(function(obj)
- if obj.Name == 'AmmoGui' then
- makeAmmoGui()
- end
- end)
- local stepped = game:GetService'RunService'.RenderStepped
- local weld2 = Instance.new('Weld', trso)
- weld2.Part0 = trso
- weld2.Part1 = rarm
- weld2.C1 = CFrame.new(0,.5,0)
- local weld = Instance.new('Weld', trso)
- weld.Part0 = trso
- weld.Part1 = larm
- weld.C1 = CFrame.new(0,-.5,0)
- while not stepped:wait() do
- local tCFrame = trso.CFrame
- local dir = (tCFrame*Vector3.new(-1.5, .5, 0) - mouse.Hit.p).unit
- local x = Vector3.new(0,1):Cross(dir)
- local z = x:Cross(dir)
- local dir = (tCFrame*Vector3.new( 1.5, .5, 0) - mouse.Hit.p).unit
- local x = Vector3.new(0,1):Cross(dir)
- local z = x:Cross(dir)
- weld2.C0 = tCFrame:inverse()*(CFrame.new(0,0,0, x.x, dir.x, z.x, x.y, dir.y, z.y, x.z, dir.z, z.z) + tCFrame*Vector3.new( 1.5, .5, 0) - dir/2)*weld2.C1
- weld.C0 = tCFrame:inverse()*(CFrame.new(0,0,0, x.x, dir.x, z.x, x.y, dir.y, z.y, x.z, dir.z, z.z) + tCFrame*Vector3.new(-1.5, .5, 0) - dir/2)*weld.C1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement