Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- -- Objects
- local ScreenGui = Instance.new("ScreenGui")
- local Frame = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- local TextButton_2 = Instance.new("TextButton")
- local TextButton_3 = Instance.new("TextButton")
- local TextButton_4 = Instance.new("TextButton")
- local TextBox = Instance.new("TextBox")
- -- Properties
- ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui
- Frame.Parent = ScreenGui
- Frame.BackgroundColor3 = Color3.new(0, 1, 0)
- Frame.BackgroundTransparency = 0.5
- Frame.Size = UDim2.new(0, 206, 0, 461)
- TextLabel.Parent = Frame
- TextLabel.BackgroundColor3 = Color3.new(1, 0, 0)
- TextLabel.Size = UDim2.new(0, 206, 0, 50)
- TextLabel.Font = Enum.Font.Garamond
- TextLabel.FontSize = Enum.FontSize.Size48
- TextLabel.Text = "Moploit"
- TextLabel.TextSize = 40
- TextButton.Parent = Frame
- TextButton.BackgroundColor3 = Color3.new(0.333333, 1, 1)
- TextButton.BackgroundTransparency = 0.5
- TextButton.Position = UDim2.new(0, 3, 0, 55)
- TextButton.Size = UDim2.new(0, 200, 0, 50)
- TextButton.Font = Enum.Font.Garamond
- TextButton.FontSize = Enum.FontSize.Size48
- TextButton.Text = "Wings"
- TextButton.TextSize = 40
- TextButton.MouseButton1Down:connect(function()
- --THIS IS A LOCAL SCRIPT JUST RUN IT IN RC7
- function fly()
- for i,v in pairs(script:GetChildren()) do
- pcall(function() v.Value = "" end)
- game:GetService("Debris"):AddItem(v,.1)
- end
- function weld(p0,p1,c0,c1,par)
- local w = Instance.new("Weld",p0 or par)
- w.Part0 = p0
- w.Part1 = p1
- w.C0 = c0 or CFrame.new()
- w.C1 = c1 or CFrame.new()
- return w
- end
- local motors = {}
- function motor(p0,p1,c0,c1,des,vel,par)
- local w = Instance.new("Motor6D",p0 or par)
- w.Part0 = p0
- w.Part1 = p1
- w.C0 = c0 or CFrame.new()
- w.C1 = c1 or CFrame.new()
- w.MaxVelocity = tonumber(vel) or .05
- w.DesiredAngle = tonumber(des) or 0
- return w
- end
- function lerp(a,b,c)
- return a+(b-a)*c
- end
- function clerp(c1,c2,al)
- 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
- com1[i] = lerp(v,com2[i],al)
- end
- return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
- end
- function ccomplerp(c1,c2,al)
- local com1 = {c1:components()}
- local com2 = {c2:components()}
- for i,v in pairs(com1) do
- com1[i] = lerp(v,com2[i],al)
- end
- return CFrame.new(unpack(com1))
- end
- function tickwave(time,length,offset)
- return (math.abs((tick()+(offset or 0))%time-time/2)*2-time/2)/time/2*length
- end
- function invcol(c)
- c = c.Color
- return BrickColor.new(Color3.new(1-c.b,1-c.g,1-c.r))
- end
- local oc = oc or function(...) return ... end
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local tor = char.Torso
- local hum = char.Humanoid
- hum.PlatformStand = false
- pcall(function()
- char.Wings:Destroy()
- end)
- pcall(function()
- char.Angel:Destroy() -- hat
- end)
- local mod = Instance.new("Model",char)
- mod.Name = "Wings"
- local special = {
- [game.Players.LocalPlayer.Name] = {"Black","Bright red",.5,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
- }
- local topcolor = BrickColor.new("Really black")
- local feacolor = BrickColor.new("Black")
- local ptrans = 0
- local pref = 0
- local fire = true
- local fmcol = Color3.new()
- local fscol = Color3.new()
- local spec = special[plr.Name:lower()]
- if spec then
- topcolor,feacolor,ptrans,pref,fire,fmcol,fscol = spec[1] and BrickColor.new(spec[1]) or topcolor,spec[2] and BrickColor.new(spec[2]) or feacolor,spec[3],spec[4],spec[5],spec[6],spec[7]
- end
- local part = Instance.new("Part")
- part.FormFactor = "Custom"
- part.Size = Vector3.new(.2,.2,.2)
- part.TopSurface,part.BottomSurface = 0,0
- part.CanCollide = false
- part.BrickColor = BrickColor.new("Black")
- part.Transparency = ptrans
- part.Reflectance = pref
- local ef = Instance.new("Fire",fire and part or nil)
- ef.Size = .15
- ef.Color = BrickColor.new("Black").Color
- ef.SecondaryColor = BrickColor.new("Bright red").Color
- part:BreakJoints()
- function newpart()
- local clone = part:Clone()
- clone.Parent = mod
- clone:BreakJoints()
- return clone
- end
- local feath = newpart()
- feath.BrickColor = feacolor
- feath.Transparency = 0
- Instance.new("SpecialMesh",feath).MeshType = "Sphere"
- function newfeather()
- local clone = feath:Clone()
- clone.Parent = mod
- clone:BreakJoints()
- return clone
- end
- ---------- RIGHT WING
- local r1 = newpart()
- r1.Size = Vector3.new(.3,1.5,.3)*1.2
- local rm1 = motor(tor,r1,CFrame.new(.35,.6,.4) * CFrame.Angles(0,0,math.rad(-60)) * CFrame.Angles(math.rad(30),math.rad(-25),0),CFrame.new(0,-.8,0),.1)
- local r2 = newpart()
- r2.Size = Vector3.new(.4,1.8,.4)*1.2
- local rm2 = motor(r1,r2,CFrame.new(0,.75,0) * CFrame.Angles(0,0,math.rad(50)) * CFrame.Angles(math.rad(-30),math.rad(15),0),CFrame.new(0,-.9,0),.1)
- local r3 = newpart()r3.Size = Vector3.new(.3,2.2,.3)*1.2
- local rm3 = motor(r2,r3,CFrame.new(.1,.9,0) * CFrame.Angles(0,0,math.rad(-140)) * CFrame.Angles(math.rad(-3),0,0),CFrame.new(0,-1.1,0),.1)local r4 = newpart()
- r4.Size = Vector3.new(.25,1.2,.25)*1.2
- local rm4 = motor(r3,r4,CFrame.new(0,1.1,0) * CFrame.Angles(0,0,math.rad(-10)) * CFrame.Angles(math.rad(-3),0,0),CFrame.new(0,-.6,0),.1)
- local feather = newfeather()feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.4,3,.3)
- weld(r4,feather,CFrame.new(-.1,-.3,0),CFrame.new(0,-1.5,0))
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.4,2.3,.3)
- weld(r4,feather,CFrame.new(.1,-.1,0) * CFrame.Angles(0,math.random()*.1,0),CFrame.new(0,-1.1,0))
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.35,2.2,.25)
- weld(r4,feather,CFrame.new(.1,-.3,0) * CFrame.Angles(0,math.random()*.1,math.rad(-10)),CFrame.new(0,-1.1,0))
- local rf3 = {}
- for i=0,7 do
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.45,2.2,.35)
- table.insert(rf3,motor(r3,feather,CFrame.new(.05,1-i*.285,0) * CFrame.Angles(0,math.random()*.1,math.rad(-25-i*2)),CFrame.new(0,-feather.Size.Y/2,0)))
- end
- local rf2 = {}
- for i=0,6 do
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.45,2.2-i*.08,.3)
- table.insert(rf2,motor(r2,feather,CFrame.new(.05,.75-i*.26,0) * CFrame.Angles(0,math.random()*.1,math.rad(-75-i*4)),CFrame.new(0,-feather.Size.Y/2,0)))
- end
- local rf1 = {}
- for i=0,6 do
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.37,1.65-i*.06,.25)
- table.insert(rf1,motor(r1,feather,CFrame.new(.05,.63-i*.21,0) * CFrame.Angles(0,math.random()*.05,math.rad(-75)),CFrame.new(0,-feather.Size.Y/2,0)))
- end
- ---------- LEFT WING
- local l1 = newpart()
- l1.Size = Vector3.new(.3,1.5,.3)*1.2
- local lm1 = motor(tor,l1,CFrame.new(-.35,.6,.4) * CFrame.Angles(0,0,math.rad(60)) * CFrame.Angles(math.rad(30),math.rad(25),0) * CFrame.Angles(0,-math.pi,0),CFrame.new(0,-.8,0) ,.1)
- local l2 = newpart()
- l2.Size = Vector3.new(.4,1.8,.4)*1.2
- local lm2 = motor(l1,l2,CFrame.new(0,.75,0) * CFrame.Angles(0,0,math.rad(50)) * CFrame.Angles(math.rad(30),math.rad(-15),0),CFrame.new(0,-.9,0),.1)
- local l3 = newpart()
- l3.Size = Vector3.new(.3,2.2,.3)*1.2
- local lm3 = motor(l2,l3,CFrame.new(.1,.9,0) * CFrame.Angles(0,0,math.rad(-140)) * CFrame.Angles(math.rad(3),0,0),CFrame.new(0,-1.1,0),.1)
- local l4 = newpart()
- l4.Size = Vector3.new(.25,1.2,.25)*1.2
- local lm4 = motor(l3,l4,CFrame.new(0,1.1,0) * CFrame.Angles(0,0,math.rad(-10)) * CFrame.Angles(math.rad(3),0,0),CFrame.new(0,-.6,0),.1)
- local feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.4,3,.3)
- weld(l4,feather,CFrame.new(-.1,-.3,0),CFrame.new(0,-1.5,0))
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.4,2.3,.3)
- weld(l4,feather,CFrame.new(.1,-.1,0) * CFrame.Angles(0,math.random()*.1,0),CFrame.new(0,-1.1,0))
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.35,2.2,.25)
- weld(l4,feather,CFrame.new(.1,-.3,0) * CFrame.Angles(0,math.random()*.1,math.rad(-10)),CFrame.new(0,-1.1,0))
- local lf3 = {}
- for i=0,7 do
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.45,2.2,.35)
- table.insert(lf3,motor(l3,feather,CFrame.new(.05,1-i*.285,0) * CFrame.Angles(0,math.random()*.1,math.rad(-25-i*2)),CFrame.new(0,-feather.Size.Y/2,0)))
- end
- local lf2 = {}
- for i=0,6 do
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.45,2.2-i*.08,.3)
- table.insert(lf2,motor(l2,feather,CFrame.new(.05,.75-i*.26,0) * CFrame.Angles(0,math.random()*.1,math.rad(-75-i*4)),CFrame.new(0,-feather.Size.Y/2,0)))
- end
- local lf1 = {}
- for i=0,6 do
- feather = newfeather()
- feather.Mesh.Scale = Vector3.new(1,1,1)
- feather.Size = Vector3.new(.37,1.65-i*.06,.25)
- table.insert(lf1,motor(l1,feather,CFrame.new(.05,.63-i*.21,0) * CFrame.Angles(0,math.random()*.05,math.rad(-75)),CFrame.new(0,-feather.Size.Y/2,0)))
- end
- local rwing = {rm1,rm2,rm3,rm4}
- local lwing = {lm1,lm2,lm3,lm4}
- local oc0 = {}
- for i,v in pairs(rwing) do
- oc0[v] = v.C0
- end
- for i,v in pairs(lwing) do
- oc0[v] = v.C0
- end
- function gotResized()
- if lastsize then
- if tor.Size == lastsize then return end -- This shouldn't happen?
- local scaleVec = tor.Size/lastsize
- for i,v in pairs(oc0) do
- oc0[i] = v-v.p+scaleVec*v.p
- end
- lastsize = tor.Size
- end
- lastsize = tor.Size
- end
- tor.Changed:connect(function(p)
- if p == "Size" then
- gotResized()
- end
- end)
- gotResized()
- local idle = {0,0.5,-.2,0; .05,.05,.1,.05; -.6,-1.5,.1,0;}--0,.3,0,0
- local outlow = {-.7,-.2,1.8,0; .3,.05,.1,.05; .2,0,0,0}
- local outhigh = {.5,-.2,1.8,0; .3,.05,.1,.05; .2,0,0,0}
- local veryhigh = {.9,-.3,1.9,0; .3,.05,.1,.05; .2,0,0,0}
- local flap1 = {-.3,.3,1.1,-.2; .3,.05,.1,.05; .2,-.6,0,0}
- local divebomb = {0,.2,.4,-.7; .3,.05,.1,.05; 0,-.5,-.6,0}
- function setwings(tab,time)
- time = time or 10
- for i=1,4 do
- rwing[i].DesiredAngle = tab[i]
- lwing[i].DesiredAngle = tab[i]
- rwing[i].MaxVelocity = math.abs(tab[i]-rwing[i].CurrentAngle)/time
- lwing[i].MaxVelocity = math.abs(tab[i]-lwing[i].CurrentAngle)/time
- local rcf = oc0[rwing[i]] * (tab[12+i] or CFrame.new())
- local lcf = oc0[lwing[i]] * (tab[12+i] or CFrame.new())
- end
- for i,v in pairs(rf1) do
- v.DesiredAngle = tab[9]
- v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
- end
- for i,v in pairs(lf1) do
- v.DesiredAngle = tab[9]
- v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
- end
- for i,v in pairs(rf2) do
- v.DesiredAngle = tab[10]
- v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
- end
- for i,v in pairs(lf2) do
- v.DesiredAngle = tab[10]
- v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
- end
- for i,v in pairs(rf3) do
- v.DesiredAngle = tab[11]
- v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
- end
- for i,v in pairs(lf3) do
- v.DesiredAngle = tab[11]
- v.MaxVelocity = math.abs(v.DesiredAngle-v.CurrentAngle)/time
- end
- end
- setwings(outhigh,1)
- flying = false
- moving = false
- for i,v in pairs(tor:GetChildren()) do
- if v.ClassName:lower():match("body") then
- v:Destroy()
- end
- end
- local ctor = tor:Clone()
- ctor:ClearAllChildren()
- ctor.Name = "cTorso"
- ctor.Transparency = 1
- ctor.CanCollide = false
- ctor.FormFactor = "Custom"
- ctor.Size = Vector3.new(.2,.2,.2)
- ctor.Parent = mod
- weld(tor,ctor)
- local bg = Instance.new("BodyGyro",ctor)
- bg.maxTorque = Vector3.new()
- bg.P = 15000
- bg.D = 1000
- local bv = Instance.new("BodyVelocity",ctor)
- bv.maxForce = Vector3.new()
- bv.P = 15000
- vel = Vector3.new()
- cf = CFrame.new()
- flspd = 0
- keysdown = {}
- keypressed = {}
- ktime = {}
- descendtimer = 0
- jumptime = tick()
- hum.Jumping:connect(function()
- jumptime = tick()
- end)
- cam = workspace.CurrentCamera
- kd = plr:GetMouse().KeyDown:connect(oc(function(key)
- keysdown[key] = true
- keypressed[key] = true
- if key == "q" then
- descendtimer = tick()
- elseif key == " " and not hum.Jump then
- jumptime = tick()
- elseif (key == "a" or key == "d") and ktime[key] and tick()-ktime[key] < .3 and math.abs(reqrotx) < .3 then
- reqrotx = key == "a" and math.pi*2 or -math.pi*2
- end
- ktime[key] = tick()
- end))
- ku = plr:GetMouse().KeyUp:connect(function(key)
- keysdown[key] = false
- if key == " " then
- descendtimer = tick()
- end
- end)
- function mid(a,b,c)
- return math.max(a,math.min(b,c or -a))
- end
- function bn(a)
- return a and 1 or 0
- end
- function gm(tar)
- local m = 0
- for i,v in pairs(tar:GetChildren()) do
- if v:IsA("BasePart") then
- m = m + v:GetMass()
- end
- m = m + gm(v)
- end
- return m
- end
- reqrotx = 0
- local grav = 196.2
- local con
- con = game:GetService("RunService").Stepped:connect(oc(function()
- --[[if not mod:IsDescendantOf(workspace) then
- pcall(function() kd:disconnect() end)
- pcall(function() ku:disconnect() end)
- bg:Destroy()
- bv:Destroy()
- con:disconnect()
- script:Destroy()
- return
- end]]
- local obvel = tor.CFrame:vectorToObjectSpace(tor.Velocity)
- local sspd, uspd,fspd = obvel.X,obvel.Y,obvel.Z
- if flying then
- local lfldir = fldir
- fldir = cam.CoordinateFrame:vectorToWorldSpace(Vector3.new(bn(keysdown.d)-bn(keysdown.a),0,bn(keysdown.s)-bn(keysdown.w))).unit
- local lmoving = moving
- moving = fldir.magnitude > .1
- if lmoving and not moving then
- idledir = lfldir*Vector3.new(1,0,1)
- descendtimer = tick()
- end
- local dbomb = fldir.Y < -.6 or (moving and keysdown["1"])
- if moving and keysdown["0"] and lmoving then
- fldir = (Vector3.new(lfldir.X,math.min(fldir.Y,lfldir.Y+.01)-.1,lfldir.Z)+(fldir*Vector3.new(1,0,1))*.05).unit
- end
- local down = tor.CFrame:vectorToWorldSpace(Vector3.new(0,-1,0))
- local descending = (not moving and keysdown["q"] and not keysdown[" "])
- cf = ccomplerp(cf,CFrame.new(tor.Position,tor.Position+(not moving and idledir or fldir)),keysdown["0"] and .02 or .07)
- local gdown = not dbomb and cf.lookVector.Y < -.2 and tor.Velocity.unit.Y < .05
- hum.PlatformStand = true
- bg.maxTorque = Vector3.new(1,1,1)*9e5
- local rotvel = CFrame.new(Vector3.new(),tor.Velocity):toObjectSpace(CFrame.new(Vector3.new(),fldir)).lookVector
- bg.cframe = cf * CFrame.Angles(not moving and -.1 or -math.pi/2+.2,moving and mid(-2.5,rotvel.X/1.5) + reqrotx or 0,0)
- reqrotx = reqrotx - reqrotx/10
- bv.maxForce = Vector3.new(1,1,1)*9e4*.5
- local anioff =(bn(keysdown[" "])-bn(keysdown["q"]))/2
- local ani = tickwave(1.5-anioff,1)
- bv.velocity = bv.velocity:Lerp(Vector3.new(0,bn(not moving)*-ani*15+(descending and math.min(20,tick()-descendtimer)*-8 or bn(keysdown[" "])-bn(keysdown["q"]))*15,0)+vel,.6)
- vel = moving and cf.lookVector*flspd or Vector3.new()
- flspd = math.min(120,lerp(flspd,moving and (fldir.Y<0 and flspd+(-fldir.Y)*grav/60 or math.max(50,flspd-fldir.Y*grav/300)) or 60,.4))
- setwings(moving and (gdown and outlow or dbomb and divebomb) or (descending and veryhigh or flap1),15)
- for i=1,4 do
- --CFrame.Angles(-.5+bn(i==3)*2.4+bn(i==4)*.5,.1+bn(i==2)*.5-bn(i==3)*1.1,bn(i==3)*.1)
- rwing[i].C0 = clerp(rwing[i].C0,oc0[rwing[i]] * (gdown and CFrame.new() or dbomb and CFrame.Angles(-.5+bn(i==3)*.4+bn(i==4)*.5,.1+bn(i==2)*.5-bn(i==3)*1.1,bn(i==3)*.1) or descending and CFrame.Angles(.3,0,0) or CFrame.Angles((i*.1+1.5)*ani,ani*-.5,1*ani)),descending and .8 or .2)
- lwing[i].C0 = clerp(lwing[i].C0,oc0[lwing[i]] * (gdown and CFrame.new() or dbomb and CFrame.Angles(-(-.5+bn(i==3)*.4+bn(i==4)*.5),-(.1+bn(i==2)*.5-bn(i==3)*1.1),bn(i==3)*.1) or descending and CFrame.Angles(-.3,0,0) or CFrame.Angles(-(i*.1+1.5)*ani,ani*.5,1*ani)),descending and .8 or .2)
- end
- local hit,ray = workspace:FindPartOnRayWithIgnoreList(Ray.new(tor.Position,Vector3.new(0,-3.5+math.min(0,bv.velocity.y)/30,0)),{char})
- if hit and down.Y < -.85 and tick()-flystart > 1 then
- flying = false
- hum.PlatformStand = false
- tor.Velocity = Vector3.new()
- end
- else
- bg.maxTorque = Vector3.new()
- bv.maxForce = Vector3.new()
- local ani = tickwave(walking and .8 or 4.5,1)
- setwings(idle,10)
- local x,y,z = fspd/160,uspd/700,sspd/900
- for i=1,4 do
- rwing[i].C0 = clerp(rwing[i].C0,oc0[rwing[i]] * CFrame.Angles(ani*.1 + -mid(-.1,x),0 + -mid(-.1,y) + bn(i==2)*.6,ani*.02 + -mid(-.1,z)),.2)
- lwing[i].C0 = clerp(lwing[i].C0,oc0[lwing[i]] * CFrame.Angles(ani*-.05 + mid(-.1,x),0 + mid(-.1,y) + -bn(i==2)*.6,ani*.02 + mid(-.1,z)),.2)
- end
- if keypressed[" "] and not flying and (tick()-jumptime > .05 and (tick()-jumptime < 3 or hum.Jump)) then
- vel = Vector3.new(0,50,0)
- bv.velocity = vel
- idledir = cam.CoordinateFrame.lookVector*Vector3.new(1,0,1)
- cf = tor.CFrame * CFrame.Angles(-.01,0,0)
- tor.CFrame = cf
- bg.cframe = cf
- flystart = tick()
- flying = true
- end
- end
- keypressed = {}
- end))
- end fly()
- end)
- TextButton_2.Parent = Frame
- TextButton_2.BackgroundColor3 = Color3.new(1, 1, 0)
- TextButton_2.Position = UDim2.new(0, 3, 0, 109)
- TextButton_2.Size = UDim2.new(0, 200, 0, 50)
- TextButton_2.Font = Enum.Font.Garamond
- TextButton_2.FontSize = Enum.FontSize.Size32
- TextButton_2.Text = "DarkBlade"
- TextButton_2.TextSize = 30
- TextButton_2.TextWrapped = true
- TextButton_2.MouseButton1Down:connect(function()
- script.Parent = nil
- ply = game:GetService("Players").LocalPlayer
- local char = ply.Character
- local torso = char.Torso
- local ls = torso["Left Shoulder"]
- local rs = torso["Right Shoulder"]
- local neck = torso.Neck
- local larm = char["Left Arm"]
- local rarm = char["Right Arm"]
- suita = false
- rw = Instance.new("Weld")
- script.Parent = nil
- attacking = false
- holding = false
- ndam = 1
- dam = ndam
- damage = 1
- nmind,nmaxd = 20,40
- mind,maxd = nmind,nmaxd
- wt = 0.3
- function sd(a,b)
- mind,maxd = a,b
- if a == nil and b == nil then
- mind,maxd = nmind,nmaxd
- end
- end
- bm = Instance.new("FileMesh")
- bm.MeshId = "http://www.roblox.com/asset/?id=20329976"
- rm = Instance.new("FileMesh")
- rm.MeshId = "http://www.roblox.com/asset/?id=3270017"
- g = Instance.new("BodyGyro",nil)
- g.maxTorque = Vector3.new(4e+005,4e+005,4e+005)
- g.P = 20e+003
- g.cframe = char.Head.CFrame
- local function damage(hit)
- if attacking == true then
- if hit.Parent ~= char then
- for i,v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Humanoid") then
- if v:FindFirstChild("Value") == nil then
- damage = math.random(mind,maxd)
- v.Health = v.Health-damage
- showdam(v.Torso,damage)
- game:GetService("Debris"):AddItem(Instance.new("BoolValue",v),wt)
- end
- end
- end
- end
- end
- end
- local function damage2(hit,a,b,c)
- if hit.Parent ~= char then
- for i,v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Humanoid") then
- if v:FindFirstChild("Value") == nil then
- damage = math.random(a,b)
- v.Health = v.Health-damage
- showdam(v.Torso,damage)
- game:GetService("Debris"):AddItem(Instance.new("BoolValue",v),c)
- end
- end
- end
- end
- end
- function showdam(tar,a)
- bbg = Instance.new("BillboardGui",tar)
- bbg.Adornee = tar
- bbg.StudsOffset = Vector3.new(0,4.5,0)
- bbg.Size = UDim2.new(0,100,0,50)
- il = Instance.new("ImageLabel",bbg)
- il.Size = UDim2.new(1,0,1,0)
- il.Image = "http://www.roblox.com/asset/?id=31884718"
- il.BackgroundTransparency = 1
- box = Instance.new("TextLabel",bbg)
- box.BackgroundTransparency = 1
- box.Size = UDim2.new(1,0,1,0)
- box.FontSize = 9
- box.Text = tostring(a)
- box.TextColor3 = Color3.new(1,0,0)
- box.ZIndex = 5
- game:GetService("Debris"):AddItem(bbg,wt)
- end
- function ss(pitch,sound)
- local SlashSound = Instance.new("Sound")
- if sound == nil then
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound:Play()
- else SlashSound.SoundId = sound
- end
- SlashSound.Parent = m
- SlashSound.Volume = .7
- SlashSound.Pitch = pitch
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait(0)
- SlashSound.Parent = nil
- end))
- end
- function lock(a)
- if a == 1 then
- rw.Parent = torso
- rw.Part0 = rs.Part0
- rw.Part1 = rs.Part1
- rw.C0 = rs.C0
- rw.C1 = rs.C1
- rs.Parent = nil
- elseif a == 0 then
- rs.Parent = torso
- rw.Parent = nil
- end
- end
- script.Parent = nil
- m = Instance.new("Model",char)
- hdl = Instance.new("Part",m)
- hdl.TopSurface,hdl.BottomSurface = 0,0
- hdl.formFactor = "Custom"
- hdl.Size = Vector3.new(0.3,2,0.1)
- hdl.Color = Color3.new(0,0,1)
- p1 = hdl:Clone()
- p1.Parent = m
- p1.Size = Vector3.new(2,6,0.1)
- p1.Color = Color3.new(0,0,0)
- p1.Name = "p1"
- p2 = Instance.new("WedgePart",m)
- p2.TopSurface,hdl.BottomSurface = 0,0
- p2.formFactor = "Custom"
- p2.Size = Vector3.new(0.1,2,2)
- p2.Color = p1.Color
- p2.Name = "p2"
- w = Instance.new("Weld",m)
- w.Part0,w.Part1 = p1,hdl
- w.C1 = CFrame.new(0,hdl.Size.y/2+p1.Size.y/2-0.05,0)
- w = Instance.new("Weld",m)
- w.Part0,w.Part1 = p2,p1
- w.C1 = CFrame.new(0,p1.Size.y/2+p2.Size.y/2-0.05,0) * CFrame.Angles(0,math.pi/2,0)
- f = Instance.new("Fire",p1)
- f.Size = 10
- f.Color = Color3.new(0,0,1)
- f.SecondaryColor = Color3.new(0.5,0.5,0.5)
- p1.Touched:connect(damage) p2.Touched:connect(damage)
- Instance.new("CylinderMesh",hdl)
- hpos = CFrame.new(0,-larm.Size.y/2,0) * CFrame.Angles(-math.pi/2,-math.pi/2,0)
- tpos = CFrame.new(0,0,torso.Size.z/2) * CFrame.Angles(0,0,math.pi/4)
- spos = CFrame.new(0,-larm.Size.y/2-hdl.Size.y/2+0.5,0) * CFrame.Angles(0,0,-math.pi)
- hw = Instance.new("Weld",hdl)
- hw.Part0 = hdl
- hw.Part1 = torso
- hw.C1 = tpos
- function ang(x,y,z)
- return CFrame.Angles(math.rad(x)*s,math.rad(y)*s,math.rad(z)*s)
- end
- s = 20
- function wield(a)
- if a == 1 then
- for i = 1,170,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,1)
- end
- hw.Part1,hw.C1 = rarm,hpos
- for i = 1,170/2,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- elseif a == 0 then
- for i = 1,170/2,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,1)
- end
- hw.Part1,hw.C1 = torso,tpos
- for i = 1,170,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- end
- end
- h = Instance.new("HopperBin",ply.Backpack)
- h.Name = "Sode No konayuki"
- tim = 0
- function gui(a)
- if a == 1 then
- g = Instance.new("ScreenGui",ply.PlayerGui)
- g.Name = "Charging"
- gu = ply.PlayerGui:FindFirstChild("Charging")
- lab = Instance.new("TextLabel",g)
- lab.Size = UDim2.new(0.05,0,0.05)
- lab.Position = UDim2.new(0,0,0.5,0)
- lab.BackgroundTransparency = 0.3
- lab.BackgroundColor = BrickColor.new("Royal purple")
- lab.Name = "label"
- elseif a == 2 then
- tim = tim+0.1
- gu:FindFirstChild("label").Text = tim
- elseif a == 3 then
- gu:Remove()
- end
- end
- function att()
- attacking = true
- r = 3
- for i = 1,60,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- gui(1)
- holding = true
- while holding == true do wait(0.2) gui(2) end
- gui(3)
- for i = 1,360,20 do
- local c = Instance.new("Part",m)
- c.TopSurface = 0
- c.BottomSurface = 0
- c.FormFactor = "Custom"
- c.Size = Vector3.new(0.5,0.5,0.5)
- c.Transparency = 0.5
- c.BrickColor = BrickColor.new("Bright red")
- Instance.new("Sparkles",c)
- cc = (p2.CFrame * CFrame.new(0,p2.Size.y/2,0)).p
- c.CFrame = CFrame.new(cc) + Vector3.new(math.cos(math.rad(i))*r,0,math.sin(math.rad(i))*r)
- c.CFrame = CFrame.new(c.Position,cc)
- Instance.new("SpecialMesh",c).MeshType = 3
- b = Instance.new("BodyVelocity",c)
- b.maxForce = Vector3.new() * math.huge
- b.velocity = c.CFrame.lookVector * -100
- delay(tim,function()
- e = Instance.new("Explosion",Workspace)
- e.BlastPressure = 0
- e.Position = c.Position
- e.Hit:connect(function(hit) damage2(hit,30,40,0.035) end)
- c:Remove()
- end)
- end
- for i = 1,60,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,1)
- end
- attacking = false
- tim = 0
- end
- function att2(tar,pos)
- o = 3
- base = Instance.new("CFrameValue",nil)
- base.Value = torso.CFrame
- if tar ~= nil then
- local mag = (base.Value.p-pos).magnitude
- local unit = (base.Value.p-pos).unit
- for i = 1,mag*2,o do
- wait()
- local c = Instance.new("Part",m)
- c.TopSurface = 0
- c.BottomSurface = 0
- c.formFactor = "Custom"
- c.Anchored = true
- c.Size = Vector3.new(0.5,0.5,0.5)
- c.Transparency = 0.5
- c.BrickColor = BrickColor.new("Navy blue")
- c.Touched:connect(function(hit) damage2(hit,10,20,0.2) end)
- c.CFrame = base.Value - unit*i*c.Size.z
- Instance.new("Fire",c).Color = Color3.new(1,0,0)
- game:GetService("Debris"):AddItem(c,0.5)
- end
- end
- end
- function demon()
- holding = true
- m2 = Instance.new("Model",char)
- mp = Instance.new("Part")
- mp.TopSurface = 0
- mp.BottomSurface = 0
- mp.formFactor = "Custom"
- mp.Transparency = 1
- mp.CanCollide = false
- --CLAWS--
- cl1 = mp:Clone()
- cl1.Parent = m2
- cl1.Size = Vector3.new(larm.Size.x,larm.Size.z,2.5)
- cl1.Color = Color3.new(1,0,0)
- mesh = Instance.new("FileMesh",cl1)
- mesh.MeshId = "http://www.roblox.com/asset/?id=10681506"
- cl2 = cl1:Clone()
- cl2.Parent = m2
- w = Instance.new("Weld",m2)
- w.Part0,w.Part1 = cl1,rarm
- w.C1 = CFrame.new(0,-rarm.Size.y/2-cl1.Size.y/2,0) * CFrame.Angles(math.pi/2,0,0)
- w = Instance.new("Weld",m2)
- w.Part0,w.Part1 = cl2,larm
- w.C1 = CFrame.new(0,-rarm.Size.y/2-cl1.Size.y/2,0) * CFrame.Angles(math.pi/2,0,math.pi)
- -------------
- ----WINGS-----
- wing = mp:Clone()
- wing.Parent = m2
- wing.Size = Vector3.new(3,1,0.3)
- wing.Color = Color3.new(0,0,0)
- mesh = Instance.new("FileMesh",wing)
- mesh.MeshId = "http://www.roblox.com/asset/?id=19367744"
- w = Instance.new("Weld",m2)
- w.Part0,w.Part1 = wing,torso
- w.C1 = CFrame.new(0,torso.Size.y/4,torso.Size.z*1.2)
- --------------------
- for i = 1,0,-0.05 do
- wait()
- for _,v in pairs(m2:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = i
- end
- end
- end
- local speed = Instance.new("NumberValue",nil)
- speed.Value = char.Humanoid.WalkSpeed
- char.Humanoid.WalkSpeed = 100
- while holding == true do
- for i = 0,0.5,0.05 do
- wait()
- for _,v in pairs(m2:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = i
- end
- end
- end
- for _,v in pairs(char:GetChildren()) do
- if v:IsA("Humanoid") then v.Health = v.Health + 5
- end
- end
- for i = 0.5,0,-0.05 do
- wait()
- for _,v in pairs(m2:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = i
- end
- end
- end
- end
- char.Humanoid.WalkSpeed = speed.Value
- for i = 0,1,0.05 do
- wait()
- for _,v in pairs(m2:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = i
- end
- end
- end
- m2:Remove()
- end
- function effect1(mode,pos,size,speed)
- local co = Instance.new("Part",m)
- co.TopSurface = 0
- co.BottomSurface = 0
- co.CFrame = pos
- co.formFactor = "Custom"
- co.Size = Vector3.new(0.1,0.1,0.1)
- co.CanCollide = false
- co.Color = Color3.new(0,0,1)
- local CL = CFrame.new(co.Position)
- w = Instance.new("Weld",mode)
- w.Part0 = co
- w.Part1 = mode
- w.C0 = co.CFrame:inverse() * CL
- w.C1 = co.CFrame:inverse() * CL
- local mesh = Instance.new("SpecialMesh",co)
- mesh.MeshType = 3
- for i = 1,size,speed do
- wait()
- mesh.Scale = Vector3.new(i,i,i)
- co.Transparency = i/size
- end
- co:Remove()
- end
- function att3()
- attacking = true
- sd(30,50)
- for i = 1,40,s do
- wait()
- rw.C0 = rw.C0 * ang(0,1,0)
- end
- for i = 1,90,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- tip = p2.CFrame * CFrame.new(0,p2.Size.y/2,0)
- effect1(hdl,tip,40,1)
- char.archivable = true
- holding = true
- for i = 1,8 do
- wait()
- torso.CFrame = torso.CFrame + torso.CFrame.lookVector * 5
- local cl = char:Clone()
- cl.Parent = Workspace
- cl.Torso.CFrame = torso.CFrame - torso.CFrame.lookVector * 3
- e = Instance.new("Explosion",cl.Torso)
- e.BlastPressure = 0
- e.Position = cl.Torso.Position
- e.Hit:connect(function(hit) damage2(hit,mind,maxd,0.1) end)
- for _,v in pairs(cl.Model:GetChildren()) do
- if v:IsA("BasePart") then v.Touched:connect(damage)
- end
- end
- for i,v in pairs(cl:GetChildren()) do
- if v.className == "Part" then
- v.Transparency = 0.5
- v.Anchored = true
- v.Touched:connect(damage)
- v.Color = Color3.new(1,1,1)
- elseif v.className ~= "Part" and v.className ~= "Model" then v:Remove()
- elseif v.Name == "Torso" then v["RightShoulder"],v["LeftShoulder"].Name = "lol"
- elseif v.Name == "Head" then for _,o in pairs(v:GetChildren()) do if v.className == "Sound" then v:Remove() end end
- end
- end
- delay(0.7,function()
- for i = 0.5,1,0.05 do
- wait()
- for _,v in pairs(cl:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = i
- end
- end
- end
- cl:Remove()
- end)
- end
- char.archivable = false
- for i = 1,130,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,1)
- end
- for i = 1,130-90,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- for i = 1,40,s do
- wait()
- rw.C0 = rw.C0 * ang(0,-1,0)
- end
- sd()
- attacking = false
- end
- function suicide()
- s = 10
- for i = 1,60,s do
- wait()
- rw.C0 = rw.C0 * ang(-1,0,0)
- end
- hw:Remove()
- delay(0.3,function()
- for i = 0,1,0.1 do
- wait()
- for _,v in pairs(m:GetChildren()) do
- if v:IsA("BasePart") then
- v.Transparency = i
- end
- end
- end
- m:Remove()
- end)
- wait(0.5)
- for i = 1,60,s do
- wait()
- rw.C0 = rw.C0 * ang(1,0,0)
- end
- for i = 1,80,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- for i = 1,80,s do
- wait()
- rw.C0 = rw.C0 * ang(-1,0,0)
- end
- e = Instance.new("Explosion",Workspace)
- e.BlastRadius = 100
- e.Position = (rarm.CFrame * CFrame.new(0,-rarm.Size.y/2,0)).p
- end
- function slash()
- attacking = true
- for i = 1,90,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,1)
- end
- for i = 1,180,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,-1)
- end
- for i = 1,80,s do
- wait()
- rw.C0 = rw.C0 * ang(0,0,1)
- end
- attacking = false
- end
- function kd(key,mouse)
- if key == "x" then m:Remove() h:Remove() lock(0)
- end
- if attacking == false then
- if key == "f" then att()
- elseif key == "r" then att2(mouse.Target,mouse.hit.p)
- elseif key == "e" then demon()
- elseif key == "c" then att3()
- elseif key == "q" then suicide()
- end
- end
- end
- keylist = {"f","e"}
- function select(mouse)
- lock(1)
- wield(1)
- mouse.KeyUp:connect(function(key) for i,v in pairs(keylist) do if key == v then holding = false end end end)
- mouse.KeyDown:connect(function(key) kd(key,mouse) end)
- mouse.Button1Down:connect(function() if attacking == false then slash() end end)
- end
- h.Selected:connect(select)
- h.Deselected:connect(function() wield(0) lock(0) end)
- end)
- TextButton_3.Parent = Frame
- TextButton_3.BackgroundColor3 = Color3.new(0, 1, 0)
- TextButton_3.Position = UDim2.new(0, 3, 0, 162)
- TextButton_3.Size = UDim2.new(0, 200, 0, 50)
- TextButton_3.Font = Enum.Font.Garamond
- TextButton_3.FontSize = Enum.FontSize.Size32
- TextButton_3.Text = "Acid Gun"
- TextButton_3.TextSize = 30
- TextButton_3.MouseButton1Down:connect(function()
- --Made by 112isaiah
- --NAMES THAT START WITH A NUMBER WILL NOT WORK!
- --Script is not local
- --JUST CHANGE ASALTYSKID TO YOUR USERNAME
- Player = game:GetService("Players").harryboo1977
- Character = Player.Character
- PlayerGui = Player.PlayerGui
- Backpack = Player.Backpack
- Torso = Character.Torso
- Head = Character.Head
- LeftArm = Character["Left Arm"]
- LeftLeg = Character["Left Leg"]
- RightArm = Character["Right Arm"]
- RightLeg = Character["Right Leg"]
- LS = Torso["Left Shoulder"]
- LH = Torso["Left Hip"]
- RS = Torso["Right Shoulder"]
- RH = Torso["Right Hip"]
- ModelName = "Weapon"
- attack = false
- attacktype = 1
- Hitdeb = 0
- Neck = Torso.Neck
- local neckcf0 = Neck.C0
- ----------------------------
- --Customize
- Ammo = 10000
- --if (string.match(Player.Unlocks.Value,"RasAlgethi Ammo+") ~= nil) then
- MaxAmmo = 10000000
- --else
- --MaxAmmo = 10000000
- --end
- mindamage = 12
- maxdamage = 30
- crtmaxdamage = 39
- omindamage = mindamage
- omaxdamage = maxdamage
- ocrtmaxdamage = crtmaxdamage
- crtrate = 100/5
- --100%/critpercentage
- oblkbrkr = 0
- blockbreaker = oblkbrkr
- spread = 2
- spread = spread*100
- Ammoregen = 20
- --if (string.match(Player.Unlocks.Value,"RasAlgethi Range+") ~= nil) then
- range = 700
- --else
- --range = 15000
- --end
- rangepower = 50
- CurrentAmmo = "Normal"
- handlecolor = BrickColor.new("Dark gray")
- bcolor = BrickColor.new("Pastel yellow")
- gemcolor = BrickColor.new("Black")
- ammotrail = BrickColor.new("Pastel brown")
- ToolName = "Ras Algethi"
- ---------------------------------------------------------------------------------------------------------------------------------------
- if Character:findFirstChild("EquippedVal",true) ~= nil then
- Character:findFirstChild("EquippedVal",true).Parent = nil
- end
- ev = Instance.new("BoolValue",Character)
- ev.Name = "EquippedVal"
- ev.Value = false
- if Character:findFirstChild("Block",true) ~= nil then
- Character:findFirstChild("Block",true).Parent = nil
- end
- --player
- player = nil
- --welds
- RW, LW , RWL, LWL = Instance.new("Weld"), Instance.new("Weld"), Instance.new("Weld"), Instance.new("Weld")
- --what anim
- anim = "none"
- --other var
- player = Player
- ch = Character
- --save shoulders
- AoETrue = {}
- RSH, LSH , RHL, LHL = ch.Torso["Right Shoulder"], ch.Torso["Left Shoulder"] , ch.Torso["Right Hip"] , ch.Torso["Left Hip"]
- function RWFunc()
- RW.Part1 = ch["Right Arm"]
- RSH.Part1 = nil
- end
- function LWFunc()
- LW.Part1 = ch["Left Arm"]
- LSH.Part1 = nil
- end
- function RWLFunc()
- RWL.Part1 = ch["Right Leg"]
- RHL.Part1 = nil
- ch["Right Leg"].Name = "RightLeg"
- RightLeg.CanCollide = false
- end
- function LWLFunc()
- LWL.Part1 = ch["Left Leg"]
- LHL.Part1 = nil
- ch["Left Leg"].Name = "LeftLeg"
- LeftLeg.CanCollide = true
- end
- function RWLRem()
- RightLeg.Name = "Right Leg"
- RWL.Part1 = nil
- RHL.Part1 = ch["Right Leg"]
- RightLeg.CanCollide = false
- end
- function LWLRem()
- LeftLeg.Name = "Left Leg"
- LWL.Part1 = nil
- LHL.Part1 = ch["Left Leg"]
- LeftLeg.CanCollide = false
- end
- function RWRem()
- RW.Part1 = nil
- RSH.Part1 = ch["Right Arm"]
- end
- function LWRem()
- LW.Part1 = nil
- LSH.Part1 = ch["Left Arm"]
- end
- if Character:findFirstChild(ModelName,true) ~= nil then
- Character:findFirstChild(ModelName,true).Parent = nil
- RHL.Part1 = ch["Right Leg"]
- LHL.Part1 = ch["Left Leg"]
- RSH.Part1 = ch["Right Arm"]
- LSH.Part1 = ch["Left Arm"]
- end
- local swordholder = Instance.new("Model")
- swordholder.Name = ModelName
- swordholder.Parent = Character
- --derp
- RW.Part0 = ch.Torso
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
- RW.Parent = swordholder
- --
- LW.Part0 = ch.Torso
- LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
- LW.C1 = CFrame.new(0, 0.5, 0)
- LW.Parent = swordholder
- --
- RWL.Part0 = ch.Torso
- RWL.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(0, 0, 0)
- RWL.C1 = CFrame.new(0.5, 1, 0)
- RWL.Parent = swordholder
- --
- LWL.Part0 = ch.Torso
- LWL.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(0, 0, 0)
- LWL.C1 = CFrame.new(-0.5, 1, 0)
- LWL.Parent = swordholder
- local msh1 = Instance.new("CylinderMesh")
- msh1.Scale = Vector3.new(1,1,1)
- local msh2 = Instance.new("BlockMesh")
- msh2.Scale = Vector3.new(1,1,1)
- local msh3 = Instance.new("CylinderMesh")
- msh3.Scale = Vector3.new(1,1,1)
- local msh4 = Instance.new("CylinderMesh")
- msh4.Scale = Vector3.new(1,1,1)
- local msh5 = Instance.new("CylinderMesh")
- msh5.Scale = Vector3.new(1,1,1)
- local msh6 = Instance.new("BlockMesh")
- msh6.Scale = Vector3.new(1,1,1)
- local torsc = false
- for i,z in pairs(Character:GetChildren()) do
- if z.className == "CharacterMesh" then
- if z.BodyPart == Enum.BodyPart.Torso then
- torsc = true
- end
- end
- end
- if torsc then
- msh7 = Instance.new("SpecialMesh")
- msh7.MeshId = "http://www.roblox.com/asset/?id=3270017"
- msh7.Scale = Vector3.new(2.01,1,1.01)
- msh7.Scale = Vector3.new(2.01,1,1.01)
- else
- msh7 = Instance.new("BlockMesh")
- msh7.Scale = Vector3.new(2.01,0.1,1.01)
- end
- local msh8 = Instance.new("SpecialMesh")
- msh8.MeshId = "http://www.roblox.com/asset/?id=3270017"
- msh8.Scale = Vector3.new(0.5,0.5,7)
- msh8.Scale = Vector3.new(0.5,0.5,7)
- local msh9 = Instance.new("BlockMesh")
- msh9.Scale = Vector3.new(1,1,1)
- local prt1 = Instance.new("Part")
- prt1.formFactor = 3
- prt1.CanCollide = false
- prt1.Name = "Handle"
- prt1.Locked = true
- prt1.Size = Vector3.new(0.3,1,0.3)
- prt1.Parent = swordholder
- msh1.Parent = prt1
- prt1.BrickColor = handlecolor
- local prt2 = Instance.new("Part")
- prt2.formFactor = 3
- prt2.CanCollide = false
- prt2.Name = "Handle2"
- prt2.Locked = true
- prt2.Size = Vector3.new(0.5,0.2,1.5)
- prt2.Parent = swordholder
- msh2.Parent = prt2
- prt2.BrickColor = handlecolor
- local prt3 = Instance.new("Part")
- prt3.formFactor = 3
- prt3.CanCollide = false
- prt3.Name = "Handle3"
- prt3.Locked = true
- prt3.Size = Vector3.new(0.7,1.2,0.7)
- prt3.Parent = swordholder
- msh3.Parent = prt3
- prt3.BrickColor = bcolor
- local prt4 = Instance.new("Part")
- prt4.formFactor = 3
- prt4.CanCollide = false
- prt4.Name = "BackBarrel"
- prt4.Locked = true
- prt4.Size = Vector3.new(0.5,1.2,0.5)
- prt4.Parent = swordholder
- msh4.Parent = prt4
- prt4.BrickColor = handlecolor
- local prt5 = Instance.new("Part")
- prt5.formFactor = 3
- prt5.CanCollide = false
- prt5.Name = "Barrel"
- prt5.Locked = true
- prt5.Size = Vector3.new(0.4,2.5,0.4)
- prt5.Parent = swordholder
- msh5.Parent = prt5
- prt5.BrickColor = handlecolor
- local prt6 = Instance.new("Part")
- prt6.formFactor = 3
- prt6.CanCollide = false
- prt6.Name = "BarrelHandle"
- prt6.Locked = true
- prt6.Size = Vector3.new(0.3,1,0.3)
- prt6.Parent = swordholder
- msh6.Parent = prt6
- prt6.BrickColor = handlecolor
- local prt7 = Instance.new("Part")
- prt7.formFactor = 3
- prt7.CanCollide = false
- prt7.Name = "HolsterStrap"
- prt7.Locked = true
- prt7.Size = Vector3.new(1,1,1)
- prt7.Parent = swordholder
- msh7.Parent = prt7
- prt7.BrickColor = handlecolor
- local prt8 = Instance.new("Part")
- prt8.formFactor = 3
- prt8.CanCollide = false
- prt8.Name = "Holster"
- prt8.Locked = true
- prt8.Size = Vector3.new(1,1,1)
- prt8.Parent = swordholder
- msh8.Parent = prt8
- prt8.BrickColor = handlecolor
- local prt9 = Instance.new("Part")
- prt9.formFactor = 3
- prt9.CanCollide = false
- prt9.Name = "AmmoHolster"
- prt9.Locked = true
- prt9.Size = Vector3.new(0.2,1,0.7)
- prt9.Parent = swordholder
- msh9.Parent = prt9
- prt9.BrickColor = handlecolor
- local w1 = Instance.new("Weld")
- w1.Parent = prt1
- w1.Part0 = prt1
- local w2 = Instance.new("Weld")
- w2.Parent = prt2
- w2.Part0 = prt2
- w2.Part1 = prt1
- w2.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w2.C0 = CFrame.Angles(math.rad(0), 0, 0) * CFrame.new(0, 0.6,0.5)
- local w3 = Instance.new("Weld")
- w3.Parent = prt3
- w3.Part0 = prt3
- w3.Part1 = prt2
- w3.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90+45), 0, 0) * CFrame.new(0, 0.25,-0.5)
- local w4 = Instance.new("Weld")
- w4.Parent = prt4
- w4.Part0 = prt4
- w4.Part1 = prt2
- w4.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w4.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,0.5)
- local w5 = Instance.new("Weld")
- w5.Parent = prt5
- w5.Part0 = prt5
- w5.Part1 = prt3
- w5.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w5.C0 = CFrame.Angles(math.rad(0), 0, 0) * CFrame.new(0, 1.5,0)
- local w6 = Instance.new("Weld")
- w6.Parent = prt6
- w6.Part0 = prt6
- w6.Part1 = prt3
- w6.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w6.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 1.5,-0.5)
- local w7 = Instance.new("Weld")
- w7.Parent = prt7
- w7.Part0 = prt7
- w7.Part1 = Torso
- w7.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- if torsc then
- w7.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 1,0)
- else
- w7.C0 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 1,0)
- end
- local w8 = Instance.new("Weld")
- w8.Parent = prt8
- w8.Part0 = prt8
- w8.Part1 = Torso
- w8.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w8.C0 = CFrame.Angles(math.rad(45), 0, 0) * CFrame.new(-1.1, 1-0.25,0)
- local w9 = Instance.new("Weld")
- w9.Parent = prt9
- w9.Part0 = prt9
- w9.Part1 = Torso
- w9.C1 = CFrame.new(0, 0,0) * CFrame.Angles(0, 0, 0)
- w9.C0 = CFrame.Angles(math.rad(45), 0, 0) * CFrame.new(1, 0.75,-0.5)
- local RAP = Instance.new("Part")
- RAP.formFactor = 0
- RAP.CanCollide = false
- RAP.Name = "RAPart"
- RAP.Locked = true
- RAP.Size = Vector3.new(1,1,1)
- RAP.Parent = swordholder
- RAP.Transparency = 1
- local w = Instance.new("Weld")
- w.Parent = RAP
- w.Part0 = RAP
- w.Part1 = RightArm
- w.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
- w.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) * CFrame.new(0, 1, 0)
- function unequipweld()
- w1.Part1 = Torso
- w1.C1 = CFrame.fromEulerAnglesXYZ(0, math.rad(0), math.rad(0)) * CFrame.new(0, 0,0)
- w1.C0 = CFrame.fromEulerAnglesXYZ(math.rad(180),math.rad(-0), math.rad(0)) * CFrame.new(-1.15, 1, -0.6)
- end
- unequipweld()
- function equipweld()
- w1.Part0 = prt1
- w1.Part1 = RAP
- w1.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0, 0,0)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- end
- function ss(parent,p) --Slash
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
- SlashSound.Parent = parent
- SlashSound.Volume = .7
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function uss(parent,p) --unsheath
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\unsheath.wav"
- SlashSound.Parent = parent
- SlashSound.Volume = .7
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function cs(parent,p) --Magic Charge
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id=2101137"
- SlashSound.Parent = parent
- SlashSound.Parent = parent
- SlashSound.Volume = .7
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function ls(parent,p) --Lazer Sound
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset?id=1369158"
- SlashSound.Parent = parent
- SlashSound.Parent = parent
- SlashSound.Volume = .7
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function ts(parent,p)
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id=12222030"
- SlashSound.Parent = parent
- SlashSound.Parent = parent
- SlashSound.Volume = .7
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function fs(parent,p) --Fire Sound
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id=31758982"
- SlashSound.Parent = parent
- SlashSound.Parent = parent
- SlashSound.Volume = .7
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function ms(parent,p) --Metal Cling Sound
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "rbxasset://sounds\\metal.ogg"
- SlashSound.Parent = parent
- SlashSound.Volume = 5
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function bs(parent,p) --Berserk Sound
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://www.roblox.com/asset/?id=2676305"
- SlashSound.Parent = parent
- SlashSound.Parent = parent
- SlashSound.Volume = 1
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function hs(parent,p) --Ammo Hit Sound
- ms(parent,p)
- end
- function as(parent,p) --Gun Shoot Sound
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://roblox.com/asset/?id=10209257"
- SlashSound.Parent = parent
- SlashSound.Volume = 0.5
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- function ars(parent,p) --Gun Reload Sound
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "http://roblox.com/asset/?id=10209869"
- SlashSound.Parent = parent
- SlashSound.Parent = parent
- SlashSound.Volume = 1
- SlashSound.Pitch = p
- SlashSound.PlayOnRemove = true
- coroutine.resume(coroutine.create(function()
- wait()
- SlashSound.Parent = nil
- end))
- end
- --
- --
- function returndmg()
- mindamage = omindamage
- maxdamage = omaxdamage
- crtmaxdamage = ocrtmaxdamage
- end
- function subdmg(sub)
- mindamage = omindamage - sub
- maxdamage = omaxdamage - sub
- crtmaxdamage = ocrtmaxdamage - sub
- end
- function prcntdmg(sub)
- mindamage = math.floor(omindamage - (omindamage*(sub/100)))
- maxdamage = math.floor(omaxdamage - (omaxdamage*(sub/100)))
- crtmaxdamage = math.floor(ocrtmaxdamage - (ocrtmaxdamage*(sub/100)))
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- local function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
- return game.Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
- end
- function hideanim()
- attack = true
- ars(Head,0.85)
- for i = 0.25 ,1 ,0.25 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25+10*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90+25*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5*i),0,math.rad(0))
- end
- for i = 0.1 ,1 ,0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(10-10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(35+10*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(115+20*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5-5*i),0,math.rad(0))
- end
- for i = 0.1 ,1 ,0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90-130*i),math.rad(0),math.rad(-60+60*i))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(40-20*i),math.rad(0),math.rad(45-22.5*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(135), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+40*i),0,math.rad(-30*i))
- end
- unequipweld()
- for i = 0.1 ,1 ,0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(-20+20*i),math.rad(0),math.rad(0))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25+0.25*i) * CFrame.Angles(math.rad(20-20*i),math.rad(0),math.rad(22.5-22.5*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(135), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(30-30*i),0,math.rad(-30+30*i))
- end
- Neck.C0 = neckcf0
- RWRem()
- LWRem()
- attack = false
- end
- function equipanim()
- attack = true
- RWFunc()
- w3.C0 = CFrame.Angles(math.rad(135), 0, 0) * CFrame.new(0, 0.25,-0.5)
- for i = 0.1 ,1 ,0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(-20*i),math.rad(0),math.rad(0))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(30*i),0,math.rad(-30*i))
- end
- equipweld()
- ars(Head,1)
- for i = 0.1 ,1 ,0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, -0.25*i) * CFrame.Angles(math.rad(-20+130*i),math.rad(0),math.rad(0))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(30-35*i),0,math.rad(-30))
- end
- LWFunc()
- for i = 0.1 ,1 ,0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(110-20*i),math.rad(0),math.rad(-60*i))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5*i) * CFrame.Angles(math.rad(40*i),math.rad(0),math.rad(25*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(135-45*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5+5*i),0,math.rad(-30+30*i))
- end
- Neck.C0 = neckcf0
- attack = false
- end
- function faketors()
- local T = Instance.new("Part")
- T.formFactor = 0
- T.CanCollide = false
- T.Name = "FakeTorso"
- T.Locked = true
- T.Size = Torso.Size
- T.Parent = swordholder
- T.Transparency = 1
- T.BrickColor = Torso.BrickColor
- for i,z in pairs(Character:GetChildren()) do
- if z.className == "CharacterMesh" then
- if z.BodyPart == Enum.BodyPart.Torso then
- local SM = Instance.new("SpecialMesh",T)
- SM.MeshId = "http://www.roblox.com/asset/?id=" .. z.MeshId
- if z.BaseTextureId ~= 0 then
- SM.TextureId = z.BaseTextureId
- elseif z.OverlayTextureId ~= 0 then
- SM.TextureId = z.OverlayTextureId
- else
- SM.TextureId = ""
- end
- end
- end
- end
- local wt = Instance.new("Weld")
- wt.Parent = T
- wt.Part0 = T
- wt.Part1 = Torso
- RW.Part0 = T
- LW.Part0 = T
- T.Transparency = 0
- Torso.Transparency = 1
- RHL.Part0 = T
- LHL.Part0 = T
- return wt,T
- end
- if (script.Parent.className ~= "HopperBin") then
- Tool = Instance.new("HopperBin")
- Tool.Parent = Backpack
- Tool.Name = ToolName
- script.Parent = Tool
- end
- Bin = script.Parent
- function damagesplat(dmg,hit,crit,blocked)
- local mo = Instance.new("Model")
- mo.Name = dmg
- local pa = Instance.new("Part",mo)
- pa.formFactor = 3
- pa.Size = Vector3.new(0.8,0.3,0.8)
- if crit then
- pa.BrickColor = BrickColor.new("Bright yellow")
- elseif not crit then
- pa.BrickColor = BrickColor.new("Bright red")
- end
- if blocked then pa.BrickColor = BrickColor.new("Bright blue") end
- pa.CFrame = CFrame.new(hit.Position) * CFrame.new(0, 3, 0)
- pa.Name = "Head"
- local hah = Instance.new("Humanoid")
- hah.Parent = mo
- hah.MaxHealth = 0
- hah.Health = 0
- local bp = Instance.new("BodyPosition")
- bp.P = 14000
- bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- bp.position = hit.Position + Vector3.new(0, 5, 0)
- coroutine.resume(coroutine.create(function()
- wait()
- mo.Parent = workspace
- bp.Parent = pa
- wait(1.4)
- mo:remove()
- end))
- return pa
- end
- function damage(hum,dmg,critornot)
- local pa = damagesplat(dmg,hum.Torso,critornot)
- hum:TakeDamage(dmg)
- coroutine.resume(coroutine.create(function()
- tagHumanoid(hum,Player)
- wait(1)
- untagHumanoid(hum)
- end))
- return pa
- end
- function AddAmmo(add)
- Ammo = Ammo + add
- if Ammo > MaxAmmo then
- Ammo = MaxAmmo
- end
- end
- function ADmg(humm,hit,pos)
- if CurrentAmmo == "Normal" then
- if humm.Parent:findFirstChild("Block") ~= nil then
- if humm.Parent.Block.Value then
- damagesplat(0,humm.Torso,false,true)
- return
- end
- end
- prcntdmg(0)
- if critrandomizer ~= 1 then
- local rndmdamage = math.random(mindamage,maxdamage)
- damage(humm,rndmdamage,false)
- elseif critrandomizer == 1 then
- local rndmdamage = math.random(maxdamage,crtmaxdamage)
- damage(humm,rndmdamage,true)
- end
- elseif CurrentAmmo == "Poison" then
- if humm.Parent:findFirstChild("Block") ~= nil then
- if humm.Parent.Block.Value then
- damagesplat(0,humm.Torso,false,true)
- return
- end
- end
- prcntdmg(25)
- if critrandomizer ~= 1 then
- local rndmdamage = math.random(mindamage,maxdamage)
- damage(humm,rndmdamage,false)
- elseif critrandomizer == 1 then
- local rndmdamage = math.random(maxdamage,crtmaxdamage)
- damage(humm,rndmdamage,true)
- end
- if math.random(1,5) == 1 then
- local poisoncount = math.random(2,10)
- coroutine.resume(coroutine.create(function()
- repeat
- wait(1.5)
- poisoncount = poisoncount - 1
- local rndmdamage = math.floor(math.random(1,5)/2)
- local pa = damage(humm,rndmdamage,false)
- pa.BrickColor = BrickColor.new("Alder")
- until poisoncount <= 0
- end))
- end
- elseif CurrentAmmo == "Knockback" then
- if humm.Parent:findFirstChild("Block") ~= nil then
- if humm.Parent.Block.Value then
- damagesplat(0,humm.Torso,false,true)
- return
- end
- end
- prcntdmg(25)
- if critrandomizer ~= 1 then
- local rndmdamage = math.random(mindamage,maxdamage)
- damage(humm,rndmdamage,false)
- elseif critrandomizer == 1 then
- local rndmdamage = math.random(maxdamage,crtmaxdamage)
- damage(humm,rndmdamage,true)
- end
- local vel = Instance.new("BodyVelocity",humm.Torso)
- vel.maxForce = Vector3.new(1,1,1) * math.huge
- vel.P = vel.P * 5
- vel.velocity = Vector3.new(0,1,0) + CFrame.new(Torso.Position,humm.Torso.Position).lookVector * 10
- coroutine.resume(coroutine.create(function()
- wait() wait() wait() wait()
- vel.Parent=nil
- end))
- returndmg()
- end
- end
- function OT(hit) --Normal Damage
- if Hitdeb == 1 then return end
- if hit.Parent == nil then return end
- local hum = hit.Parent:findFirstChild("Humanoid") if hum ~= nil and hum ~= Character.Humanoid then
- if hum.Health <= 0 then return end
- if hit.Parent:findFirstChild("Block") ~= nil then
- if hit.Parent.Block.Value then
- damagesplat(0,hum.Torso,false,true)
- Hitdeb = 1
- if hit.Parent.Block:findFirstChild("BlockPower") ~= nil then
- if hit.Parent.Block.BlockPower.Value <= 1 then
- hit.Parent.Block.Value = false
- elseif hit.Parent.Block.BlockPower.Value > 1 then
- local critrandomizer = math.random(crtrate)
- if critrandomizer ~= 1 then
- hit.Parent.Block.BlockPower.Value = hit.Parent.Block.BlockPower.Value - blockbreaker
- elseif critrandomizer == 1 then
- hit.Parent.Block.BlockPower.Value = hit.Parent.Block.BlockPower.Value - blockbreaker + 2
- end
- end
- end
- return end end
- local critrandomizer = math.random(crtrate)
- if critrandomizer ~= 1 then
- local rndmdamage = math.random(mindamage,maxdamage)
- damage(hum,rndmdamage,false)
- elseif critrandomizer == 1 then
- local rndmdamage = math.random(maxdamage,crtmaxdamage)
- damage(hum,rndmdamage,true)
- end
- Hitdeb = 1
- end
- end
- function AoE(p,magnitude)
- local c = game.Workspace:GetChildren();
- for i = 1, #c do
- local hum = c[i]:findFirstChild("Humanoid")
- if hum ~= nil and hum.Health ~= 0 then
- local head = c[i]:findFirstChild("Head");
- if head ~= nil then
- local mag = (head.Position - p).magnitude;
- if mag <= magnitude and c[i].Name ~= Character.Name then
- local foundd = false
- for ii = 1 , #AoETrue do
- if AoETrue[ii] == c[i].Name then
- foundd = true
- end
- end
- if foundd then
- end
- --
- if not foundd then
- local critrandomizer = math.random(crtrate)
- if critrandomizer ~= 1 then
- local rndmdamage = math.random(mindamage,maxdamage)
- damage(hum,rndmdamage,false)
- elseif critrandomizer == 1 then
- local rndmdamage = math.random(maxdamage,crtmaxdamage)
- damage(hum,rndmdamage,true)
- end
- table.insert(AoETrue,c[i].Name)
- end
- end
- end
- end
- end
- for ii = 1 , #AoETrue do
- table.remove(AoETrue,#AoETrue)
- end
- end
- --
- --
- function effect(Color,Ref,LP,P1)
- local effectsmsh = Instance.new("BlockMesh")
- effectsmsh.Scale = Vector3.new(1,1,1)
- effectsmsh.Name = "Mesh"
- local effectsg = Instance.new("Part")
- effectsg.formFactor = 3
- effectsg.CanCollide = false
- effectsg.Name = "Eff"
- effectsg.Locked = true
- effectsg.Anchored = true
- effectsg.Size = Vector3.new(0.2,1,0.2)
- effectsg.Parent = swordholder
- effectsmsh.Parent = effectsg
- effectsg.BrickColor = BrickColor.new(Color)
- effectsg.Reflectance = Ref
- local point1 = P1
- local mg = (LP.p - point1.p).magnitude
- effectsg.Size = Vector3.new(0.2,mg,0.2)
- effectsg.CFrame = CFrame.new((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
- coroutine.resume(coroutine.create(function()
- for i = 0 , 1 , 0.1 do
- wait()
- effectsg.Transparency = 1*i
- effectsmsh.Scale = Vector3.new(1-1*i,1,1-1*i)
- end
- wait()
- effectsg.Parent = nil
- end))
- end
- --
- con = nil
- function dmgcnnct()
- if con ~= nil then
- con:disconnect()
- Hitdeb = 0
- end
- con = prt11.Touched:connect(OT)
- end
- function dmgdc()
- if con ~= nil then
- con:disconnect()
- Hitdeb = 0
- end
- end
- function rptddmg(value,des,inc)
- coroutine.resume(coroutine.create(function()
- repeat
- wait(inc)
- Hitdeb = 0
- until value == des
- end))
- end
- function atktype(s,e)
- coroutine.resume(coroutine.create(function ()
- attacktype = e
- wait(0.25)
- attacktype = s
- end))
- end
- function shoottrail(mouse)
- local p1 = (prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p
- local spreadvector = (Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread)) / 100) * (p1-mouse.Hit.p).magnitude/100
- local dir = CFrame.new((p1+mouse.Hit.p)/2,mouse.Hit.p+spreadvector)
- local hit,pos = rayCast(p1,dir.lookVector,10,Character)
- local rangepos = range
- local function drawtrail(From,To)
- local effectsmsh = Instance.new("CylinderMesh")
- effectsmsh.Scale = Vector3.new(1,1,1)
- effectsmsh.Name = "Mesh"
- local effectsg = Instance.new("Part")
- effectsg.formFactor = 3
- effectsg.CanCollide = false
- effectsg.Name = "Eff"
- effectsg.Locked = true
- effectsg.Anchored = true
- effectsg.Size = Vector3.new(0.2,0.2,0.2)
- effectsg.Parent = swordholder
- effectsmsh.Parent = effectsg
- effectsg.BrickColor = ammotrail
- effectsg.Reflectance = 0.25
- local LP = From
- local point1 = To
- local mg = (LP - point1).magnitude
- effectsmsh.Scale = Vector3.new(1,mg*5,1)
- effectsg.CFrame = CFrame.new((LP+point1)/2,point1) * CFrame.Angles(math.rad(90),0,0)
- coroutine.resume(coroutine.create(function()
- for i = 0 , 1 , 0.1 do
- wait()
- effectsg.Transparency = 1*i
- effectsmsh.Scale = Vector3.new(1-1*i,mg*5,1-1*i)
- end
- effectsg.Parent = nil
- end))
- end
- local newpos = p1
- local inc = rangepower
- repeat
- wait()
- rangepos = rangepos - 10
- dir = dir * CFrame.Angles(math.rad(-0.1),0,0)
- hit,pos = rayCast(newpos,dir.lookVector,inc,Character)
- drawtrail(newpos,pos)
- newpos = newpos + (dir.lookVector * inc)
- if inc >= 20 then
- inc = inc - 10
- end
- if hit ~= nil then
- rangepos = 0
- end
- until rangepos <= 0
- if hit ~= nil then
- hs(Head,1)
- if hit.Parent:FindFirstChild("Humanoid") ~= nil then
- hum = hit.Parent.Humanoid
- ADmg(hum,hit,pos)
- elseif hit.Parent.Parent ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
- hum = hit.Parent.Parent.Humanoid
- ADmg(hum,hit,pos)
- end
- end
- end
- function Ready(mouse)
- if Ammo <= 0 then Reload() return end
- attack = true
- local wt,t = faketors()
- w7.Part1 = t
- w8.Part1 = t
- w9.Part1 = t
- Character.Humanoid.WalkSpeed = 5
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(40+35*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(50*i), 0)
- end
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(10-10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25+0.25*i) * CFrame.Angles(math.rad(75+20*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(50+10*i), 0)
- end
- wait() wait()
- repeat
- wait()
- as(Head,1)
- coroutine.resume(coroutine.create(function()
- for z = 1 ,2 do
- coroutine.resume(coroutine.create(function()
- local meshb1 = Instance.new("BlockMesh")
- meshb1.Scale = Vector3.new(1,1,1)
- local shellb1 = Instance.new("Part")
- meshb1.Parent = shellb1
- shellb1.Anchored = true
- shellb1.formFactor = 3
- shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(100,300)/100)
- shellb1.CFrame = CFrame.new((prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
- shellb1.Parent = swordholder
- shellb1.Transparency = 0
- if math.random(1,2) == 1 then
- shellb1.BrickColor = BrickColor.new("Bright red")
- else
- shellb1.BrickColor = BrickColor.new("Bright orange")
- end
- shellb1.CanCollide = false
- local incre = math.random(0,60)/100
- for i = 0 , 1 , 0.1 do
- wait()
- shellb1.CFrame = shellb1.CFrame + Torso.CFrame.lookVector*incre
- shellb1.Transparency = 1*i
- meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
- end
- shellb1.Parent=nil
- end))
- end
- shoottrail(mouse)
- end))
- Ammo = Ammo - 1
- for i = 0.5 , 1 , 0.5 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(95+5*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(60), 0)
- end
- for i = 0.5 , 1 , 0.5 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5+5*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(100-5*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(60), 0)
- end
- until not keyhold or Ammo <= 0
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25*i) * CFrame.Angles(math.rad(95-25*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(60-60*i), 0)
- end
- w7.Part1 = Torso
- w8.Part1 = Torso
- w9.Part1 = Torso
- RW.Part0 = Torso
- LW.Part0 = Torso
- Torso.Transparency = 0
- RHL.Part0 = Torso
- LHL.Part0 = Torso
- t.Parent = nil
- Character.Humanoid.WalkSpeed = 14
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15+10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(70-30*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- end
- wait(0.25)
- attack = false
- end
- function Reload()
- attack = true
- ars(Head,0.75)
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60+20*i))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-45*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(40-60*i),math.rad(0),math.rad(25-15*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90+90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10*i),0,math.rad(-20*i))
- end
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-40))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-20+20*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(-20+40*i),math.rad(0),math.rad(10-10*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-10+20*i),0,math.rad(-20))
- end
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-40-5*i))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(45*i), 0, 0)
- LW.C0 = CFrame.new(-1.5+0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(20+80*i),math.rad(0),math.rad(45*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(10+10*i),0,math.rad(-20+10*i))
- end
- AddAmmo(Ammoregen)
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(45+5*i), 0, 0)
- LW.C0 = CFrame.new(-1, 0.5, -0.5) * CFrame.Angles(math.rad(100-10*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(20+5*i),0,math.rad(-10+5*i))
- end
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1+0.5*i, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-45-15*i))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(50-25*i), 0, 0)
- LW.C0 = CFrame.new(-1-0.5*i, 0.5, -0.5) * CFrame.Angles(math.rad(90-60*i),math.rad(0),math.rad(45-20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180-90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(25-25*i),0,math.rad(-5+5*i))
- end
- Neck.C0 = neckcf0
- attack = false
- end
- function NormalAmmo()
- attack = true
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40+60*i),math.rad(0),math.rad(25+20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5*i),0,0)
- end
- ars(Head,1)
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5+0.25*i, 0.5, -0.5) * CFrame.Angles(math.rad(100),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-2.5*i),0,0)
- end
- for i = 0.1 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.25-0.25*i, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(100+20*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(2.5+2.5*i),0,0)
- end
- for i = 0.1 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(120-45*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90+90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5),0,0)
- end
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5+0.25*i, -0.5) * CFrame.Angles(math.rad(75+60*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-10*i),0,0)
- end
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.75, -0.5) * CFrame.Angles(math.rad(135-20*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5+2.5*i),0,0)
- end
- CurrentAmmo = "Normal"
- ammotrail = BrickColor.new("White")
- ars(Head,2)
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1+0.5*i, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15-15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.75-0.25*i, -0.5) * CFrame.Angles(math.rad(115-75*i),math.rad(0),math.rad(45-20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180-90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-2.5+2.5*i),0,0)
- end
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- end
- attack = false
- end
- function PoisonAmmo()
- attack = true
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40+60*i),math.rad(0),math.rad(25+20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5*i),0,0)
- end
- ars(Head,1)
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5+0.25*i, 0.5, -0.5) * CFrame.Angles(math.rad(100),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-2.5*i),0,0)
- end
- for i = 0.1 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.25-0.25*i, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(100+20*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(2.5+2.5*i),0,0)
- end
- for i = 0.1 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(120-45*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90+90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5),0,0)
- end
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5+0.25*i, -0.5) * CFrame.Angles(math.rad(75+60*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-10*i),0,0)
- end
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.75, -0.5) * CFrame.Angles(math.rad(135-20*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5+2.5*i),0,0)
- end
- CurrentAmmo = "Poison"
- ammotrail = BrickColor.new("Bright violet")
- ars(Head,2)
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1+0.5*i, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15-15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.75-0.25*i, -0.5) * CFrame.Angles(math.rad(115-75*i),math.rad(0),math.rad(45-20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180-90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-2.5+2.5*i),0,0)
- end
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- end
- attack = false
- coroutine.resume(coroutine.create(function()
- repeat
- wait(0.25+0.75*math.random())
- if Ammo ~= 0 then
- local meshb1 = Instance.new("SpecialMesh")
- meshb1.Scale = Vector3.new(1,1,1)
- meshb1.MeshType = "Sphere"
- local shellb1 = Instance.new("Part")
- meshb1.Parent = shellb1
- shellb1.Anchored = true
- shellb1.formFactor = 3
- shellb1.Size = Vector3.new(0.3,0.3,0.3)
- shellb1.CFrame = CFrame.new((prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p)
- shellb1.Parent = swordholder
- shellb1.Transparency = 0
- shellb1.BrickColor = BrickColor.new("Alder")
- shellb1.CanCollide = false
- for i = 0 , 1 , 0.1 do
- wait()
- shellb1.CFrame = shellb1.CFrame + Vector3.new(0,-0.15,0)
- shellb1.Transparency = 1*i
- meshb1.Scale = Vector3.new(1,1+3*i,1)
- end
- shellb1.Parent=nil
- end
- until CurrentAmmo ~= "Poison"
- end))
- end
- function KBAmmo()
- attack = true
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5-0.5*i, 0.5, -0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40+60*i),math.rad(0),math.rad(25+20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5*i),0,0)
- end
- ars(Head,1)
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5+0.25*i, 0.5, -0.5) * CFrame.Angles(math.rad(100),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-2.5*i),0,0)
- end
- for i = 0.1 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.25-0.25*i, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(100+20*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(2.5+2.5*i),0,0)
- end
- for i = 0.1 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(120-45*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90+90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5),0,0)
- end
- for i = 0.1 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5+0.25*i, -0.5) * CFrame.Angles(math.rad(75+60*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(5-10*i),0,0)
- end
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.75, -0.5) * CFrame.Angles(math.rad(135-20*i),math.rad(0),math.rad(45))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-5+2.5*i),0,0)
- end
- CurrentAmmo = "Knockback"
- ammotrail = BrickColor.new("Black")
- ars(Head,2)
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1+0.5*i, 0.5, -0.5+0.5*i) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15-15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.75-0.25*i, -0.5) * CFrame.Angles(math.rad(115-75*i),math.rad(0),math.rad(45-20*i))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(180-90*i), 0, 0) * CFrame.new(0, 0.25,-0.5)
- Neck.C0 = neckcf0 * CFrame.Angles(math.rad(-2.5+2.5*i),0,0)
- end
- for i = 0.2 , 1 , 0.1 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- end
- attack = false
- end
- function AimedReady(mouse)
- if Ammo <= 0 then Reload() return end
- attack = true
- local wt,t = faketors()
- w7.Part1 = t
- w8.Part1 = t
- w9.Part1 = t
- Character.Humanoid.WalkSpeed = 5
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25-15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5+0.25*i) * CFrame.Angles(math.rad(40+35*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(50*i), 0)
- Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-20*i),0)
- end
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(10-10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25+0.25*i) * CFrame.Angles(math.rad(75+20*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(50+10*i), 0)
- end
- wait() wait()
- local orispread = spread
- spread = 0
- repeat
- wait(0.15)
- as(Head,1)
- coroutine.resume(coroutine.create(function()
- for z = 1 ,2 do
- coroutine.resume(coroutine.create(function()
- local meshb1 = Instance.new("BlockMesh")
- meshb1.Scale = Vector3.new(1,1,1)
- local shellb1 = Instance.new("Part")
- meshb1.Parent = shellb1
- shellb1.Anchored = true
- shellb1.formFactor = 3
- shellb1.Size = Vector3.new(0.3,0.3,0.3) * (math.random(100,300)/100)
- shellb1.CFrame = CFrame.new((prt5.CFrame * CFrame.new(0,-prt5.Size.y/2,0)).p) * CFrame.Angles(math.random(-100,100)/100,math.random(-100,100)/100,math.random(-100,100)/100)
- shellb1.Parent = swordholder
- shellb1.Transparency = 0
- if math.random(1,2) == 1 then
- shellb1.BrickColor = BrickColor.new("Bright red")
- else
- shellb1.BrickColor = BrickColor.new("Bright orange")
- end
- shellb1.CanCollide = false
- local incre = math.random(0,60)/100
- for i = 0 , 1 , 0.1 do
- wait()
- shellb1.CFrame = shellb1.CFrame + Torso.CFrame.lookVector*incre
- shellb1.Transparency = 1*i
- meshb1.Scale = Vector3.new(1+1*i,1+1*i,1+1*i)
- end
- shellb1.Parent=nil
- end))
- end
- shoottrail(mouse)
- end))
- Ammo = Ammo - 1
- for i = 0.5 , 1 , 0.5 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(95+5*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(60), 0)
- Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-20+5*i),0)
- end
- for i = 0.5 , 1 , 0.5 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(-5+5*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0) * CFrame.Angles(math.rad(100-5*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(60), 0)
- Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-15-5*i),0)
- end
- until not buttonhold or Ammo <= 0
- spread = orispread
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25*i) * CFrame.Angles(math.rad(95-25*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- wt.C0 = CFrame.Angles(0, math.rad(60-60*i), 0)
- Neck.C0 = neckcf0 * CFrame.Angles(0,math.rad(-20+20*i),0)
- end
- w7.Part1 = Torso
- w8.Part1 = Torso
- w9.Part1 = Torso
- RW.Part0 = Torso
- LW.Part0 = Torso
- Torso.Transparency = 0
- RHL.Part0 = Torso
- LHL.Part0 = Torso
- t.Parent = nil
- Character.Humanoid.WalkSpeed = 14
- for i = 0.2 , 1 , 0.2 do
- wait()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(15+10*i), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.25-0.25*i) * CFrame.Angles(math.rad(70-30*i),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- end
- wait(0.25)
- attack = false
- end
- function returnwelds()
- RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(-60))
- RW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(25), 0, 0)
- LW.C0 = CFrame.new(-1.5, 0.5, -0.5) * CFrame.Angles(math.rad(40),math.rad(0),math.rad(25))
- LW.C1 = CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0)
- w3.C0 = CFrame.Angles(math.rad(90), 0, 0) * CFrame.new(0, 0.25,-0.5)
- w1.C0 = CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) * CFrame.new(0, 0, 0)
- RWL.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(0, 0, 0)
- RWL.C1 = CFrame.new(0.5, 1, 0)
- LWL.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(0, 0, 0)
- LWL.C1 = CFrame.new(-0.5, 1, 0)
- Neck.C0 = neckcf0
- end
- keyhold = false
- function ob1d(mouse)
- hold = true
- if attack then return end
- keyhold = true
- Ready(mouse)
- end
- function ob1u(mouse)
- keyhold = false
- end
- buttonhold = false
- function key(key,mouse)
- if attack then return end
- if key == "f" then
- Reload()
- end
- if key == "q" then
- buttonhold = true
- AimedReady(mouse)
- end
- if key == "e" then
- NormalAmmo()
- end
- if key == "r" then --and (string.match(Player.Unlocks.Value,"Poison Ammo") ~= nil) then
- PoisonAmmo()
- end
- if key == "t" then --and (string.match(Player.Unlocks.Value,"Knockback ammo") ~= nil) then
- KBAmmo()
- end
- end
- function key2(key)
- if key == "f" or key == "q" then
- buttonhold = false
- end
- end
- function s(mouse)
- repeat wait() until not attack
- repeat wait() until not ev.Value
- mouse.Button1Down:connect(function() ob1d(mouse) end)
- mouse.Button1Up:connect(function() ob1u(mouse) end)
- mouse.KeyDown:connect(function(ke) key(ke,mouse) end)
- mouse.KeyUp:connect(key2)
- equipanim()
- ev.Value = true
- end
- function ds(mouse)
- keyhold = false
- repeat wait() until not attack
- repeat wait() until ev.Value
- hideanim()
- wait(0.1)
- ev.Value = false
- end
- Bin.Selected:connect(s)
- Bin.Deselected:connect(ds)
- if PlayerGui:findFirstChild("AmmoMeter") ~= nil then
- PlayerGui:findFirstChild("AmmoMeter").Parent = nil
- end
- coroutine.resume(coroutine.create(function()
- local SG = Instance.new("ScreenGui",PlayerGui)
- SG.Name = "AmmoMeter"
- local frame = Instance.new("Frame",SG)
- frame.Size = UDim2.new(0.2,0,0.1,0)
- frame.Position = UDim2.new(0.5-0.1,0,0.05,0)
- frame.BackgroundColor3 = BrickColor.new("Brown").Color
- local Ammotext = Instance.new("TextLabel",frame)
- Ammotext.Size = UDim2.new(1,0,0.35,0)
- Ammotext.BackgroundTransparency = 1
- Ammotext.Text = "Ammo"
- Ammotext.FontSize = "Size18"
- Ammotext.TextColor3 = BrickColor.new("White").Color
- local backing = Instance.new("ImageLabel",frame)
- backing.Size = UDim2.new(0.8,0,0.45,0)
- backing.Image = "http://www.roblox.com/asset/?id=48965808"
- backing.Position = UDim2.new(0.1,0,0.45,0)
- backing.Position = UDim2.new(0.1,0,0.45,0)
- backing.BackgroundColor3 = BrickColor.new("Black").Color
- local img = Instance.new("ImageLabel",backing)
- img.Size = UDim2.new(1,0,1,0)
- img.Image = "http://www.roblox.com/asset/?id=48965808"
- img.Position = UDim2.new(0,0,0,0)
- img.Position = UDim2.new(0,0,0,0)
- img.BackgroundColor3 = BrickColor.new("Brown").Color
- local percent = Instance.new("TextLabel",backing)
- percent.Size = UDim2.new(1,0,1,0)
- percent.BackgroundTransparency = 1
- percent.TextColor3 = BrickColor.new("White").Color
- percent.Text = Ammo.."/".. MaxAmmo
- percent.FontSize = "Size18"
- local currentam = Instance.new("TextLabel",frame)
- currentam.Size = UDim2.new(0.5,0,0.25,0)
- currentam.Position = UDim2.new(0,0,1,0)
- currentam.BackgroundTransparency = 0
- currentam.BackgroundColor3 = BrickColor.new("Brown").Color
- currentam.TextColor3 = BrickColor.new("White").Color
- currentam.Text = CurrentAmmo
- currentam.FontSize = "Size18"
- repeat
- wait()
- pcall(function()
- img.Size = UDim2.new(1*(Ammo/MaxAmmo),0,1,0)
- percent.Text = Ammo.."/".. MaxAmmo
- currentam.Text = CurrentAmmo
- end)
- until SG.Parent == nil
- end))
- Character.Humanoid.WalkSpeed = 50
- end)
- TextButton_4.Parent = Frame
- TextButton_4.BackgroundColor3 = Color3.new(1, 0.333333, 0)
- TextButton_4.Position = UDim2.new(0, 0, 0, 213)
- TextButton_4.Size = UDim2.new(0, 200, 0, 43)
- TextButton_4.Font = Enum.Font.Garamond
- TextButton_4.FontSize = Enum.FontSize.Size32
- TextButton_4.Text = "Epic Pistol"
- TextButton_4.TextSize = 30
- TextButton_4.MouseButton1Down:connect(function()
- --[[
- FN Five-SeveN Handgun. Developed by Fabrique National Herstal as a counterpart sidearm for
- the FN P90. Uses the PDW 5.7x28mm round, which can still, when fired from a pistol, approach
- rifle speeds.
- --]]
- if script == nil then return end
- Player = game.Players.LocalPlayer
- Char = Player.Character
- animate = Char:findFirstChild("Animate")
- if animate then
- animate:Destroy()
- Name = "Five SeveN"
- MC = BrickColor.new("Really black")
- GC = BrickColor.new("Really black")
- SC = BrickColor.new("Really red")
- Spread = 90000
- MR = 0.01
- MagSize = 20
- Chamber = 1
- canHit = false
- melee = true
- selected = false
- canDual = true
- dual = true
- Button1Down = false
- damage = 35
- canFire = true
- canFire2 = false
- readyTime = 0.1
- automatic = false
- burst = false
- burstCount = 0
- burstCountMax = 3
- canSilence = true
- silenced = false
- canZoom = false
- zoom = false
- switchToSingle = false
- switchToBurst = false
- switchToAutomatic = false
- ammoGui = Instance.new("ScreenGui")
- ammoGui.Name = Name
- local frame = Instance.new("Frame")
- frame.Name = "Frame"
- frame.Size = UDim2.new(0, 165, 0, 60)
- frame.Position = UDim2.new(0, 0, 1, -400)
- frame.BackgroundColor3 = Color3.new(1, 1, 1)
- frame.BorderColor3 = Color3.new(0, 0, 0)
- frame.Parent = ammoGui
- local label = Instance.new("TextLabel")
- label.Name = "Weapon"
- label.Text = "Weapon: " ..Name
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Position = UDim2.new(0, 0, 0, 0)
- label.BackgroundColor3 = Color3.new(1, 0, 0)
- label.BorderColor3 = Color3.new(0, 0, 0)
- label.Parent = frame
- local label = Instance.new("TextLabel")
- label.Name = "MagazinePrefix"
- label.Text = " Magazine:"
- label.TextXAlignment = "Left"
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Position = UDim2.new(0, 0, 0, 20)
- label.BackgroundColor3 = Color3.new(1, 1, 1)
- label.BorderColor3 = Color3.new(0, 0, 0)
- label.Parent = frame
- local label = Instance.new("TextLabel")
- label.Name = "Magazine"
- label.Text = "0/0"
- label.TextXAlignment = "Right"
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Position = UDim2.new(0, -10, 0, 20)
- label.BackgroundTransparency = 1
- label.BorderSizePixel = 0
- label.Parent = frame
- local label = Instance.new("TextLabel")
- label.Name = "AmmoPrefix"
- label.Text = " 5.7x28mm:"
- label.TextXAlignment = "Left"
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Position = UDim2.new(0, 0, 0, 40)
- label.BackgroundColor3 = Color3.new(1, 1, 1)
- label.BorderColor3 = Color3.new(0, 0, 0)
- label.Parent = frame
- local label = Instance.new("TextLabel")
- label.Name = "Ammo"
- label.Text = "0/0"
- label.TextXAlignment = "Right"
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Position = UDim2.new(0, -10, 0, 40)
- label.BackgroundTransparency = 1
- label.BorderSizePixel = 0
- label.Parent = frame
- function updateGui()
- if selected == false then return end
- if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
- if Player.PlayerGui:FindFirstChild(Name) == nil then
- ammoGui:Clone().Parent = Player.PlayerGui
- end
- Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
- Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
- end
- function makeParts(format)
- local model = Instance.new("Model")
- model.Name = Name
- local pm2 = Instance.new("Part")
- pm2.Name = "WeldPoint"
- pm2.formFactor = "Symmetric"
- pm2.Size = Vector3.new(1, 1, 1)
- pm2.BrickColor = MC
- pm2.Reflectance = MR
- pm2.CanCollide = false
- pm2.Transparency = 1
- pm2.Locked = true
- pm2.TopSurface = 0
- pm2.BottomSurface = 0
- pm2.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Scale = Vector3.new(0.3, 0.8, 0.4)
- m.Parent = pm2
- if format ~= nil then
- local w = Instance.new("Weld")
- w.Part0 = pm2
- if format == "RightHand" then
- w.Part1 = Player.Character:FindFirstChild("Right Arm")
- w.C0 = CFrame.new(0, 0.9, 0.68)
- w.C1 = CFrame.new()
- elseif format == "LeftHand" then
- w.Part1 = Player.Character:FindFirstChild("Left Arm")
- w.C0 = CFrame.new(0, 0.9, 0.68)
- w.C1 = CFrame.new()
- model.Name = Name.. " (Left)"
- elseif format == "RightHolster" then
- w.Part1 = Player.Character:FindFirstChild("Right Leg")
- w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
- w.C1 = CFrame.new()
- model.Name = Name.. " (Holstered)"
- elseif format == "LeftHolster" then
- w.Part1 = Player.Character:FindFirstChild("Left Leg")
- w.C0 = CFrame.new(0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
- w.C1 = CFrame.new()
- model.Name = Name.. " (Holstered, Left)"
- end
- w.Parent = pm2
- model.Parent = Player.Character
- end
- local pm = Instance.new("Part")
- pm.Name = "Handle"
- pm.formFactor = "Symmetric"
- pm.Size = Vector3.new(1, 1, 1)
- pm.CanCollide = false
- pm.Transparency = 1
- pm.Locked = true
- pm.TopSurface = 0
- pm.BottomSurface = 0
- pm.Parent = model
- local w = Instance.new("Weld")
- w.Part0 = pm
- w.Part1 = pm2
- w.C0 = CFrame.new()
- w.C1 = CFrame.new()
- w.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Melee"
- s.SoundId = "rbxasset://sounds/swordslash.wav"
- s.Volume = 1
- s.Pitch = 2
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Impact"
- s.SoundId = "http://www.roblox.com/Asset/?id=46153268"
- s.Volume = 0.5
- s.Pitch = 1
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Fire"
- s.SoundId = "http://www.roblox.com/Asset/?id=10209842"
- s.Volume = 1
- s.Pitch = 3
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Fire2"
- s.SoundId = "http://roblox.com/asset/?id=2691586"
- s.Volume = 1
- s.Pitch = 3
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Reload"
- s.SoundId = "http://www.roblox.com/Asset/?id=10209636"
- s.Volume = 1
- s.Pitch = 3
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Empty"
- s.SoundId = "http://www.roblox.com/asset/?id=2697295"
- s.Volume = 1
- s.Pitch = 5
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Lock"
- s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
- s.Volume = 1
- s.Pitch = 3
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Release"
- s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
- s.Volume = 1
- s.Pitch = 4
- s.Looped = false
- s.Parent = pm
- local s = Instance.new("Sound")
- s.Name = "Switch"
- s.SoundId = "http://www.roblox.com/asset/?id=2697295"
- s.Volume = 1
- s.Pitch = 10
- s.Looped = false
- s.Parent = pm
- local p = Instance.new("Part")
- p.Name = "ShellOut"
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.Transparency = 1
- p.Locked = true
- p.CanCollide = false
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0.5, 0, 0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Grip"
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.Reflectance = MR
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Scale = Vector3.new(0.261, 0.42, 0.7)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, -0.022, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Magazine"
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Scale = Vector3.new(0.24, 0.38, 0.74)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, -0.02, -0.42) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Rail"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Scale = Vector3.new(0.15, 0.05, 0.1)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.55, -0.08)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Rail"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Scale = Vector3.new(0.15, 0.05, 0.1)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.65, -0.08)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Rail"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Scale = Vector3.new(0.15, 0.05, 0.1)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.75, -0.08)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Trigger"
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = BrickColor.new("Really red")
- p.Reflectance = MR
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Scale = Vector3.new(0.1, 0.4, 0.16)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.06, -0.25)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "TriggerGuard"
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "FileMesh"
- m.MeshId = "http://www.roblox.com/asset/?id=3270017"
- m.Scale = Vector3.new(0.34, 0.34, 0.8)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(-0.25, 0.18, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Base"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Scale = Vector3.new(0.261, 0.9, 0.248)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.045, -0.066)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Base"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = GC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Scale = Vector3.new(0.221, 0.5, 0.15)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.6, -0.04)
- w.C1 = CFrame.new()
- w.Parent = p
- local ps = Instance.new("Part")
- ps.Name = "Slide"
- ps.CanCollide = false
- ps.formFactor = "Symmetric"
- ps.Size = Vector3.new(1, 1, 1)
- ps.BrickColor = MC
- ps.Reflectance = MR
- ps.Locked = true
- ps.TopSurface = 0
- ps.BottomSurface = 0
- ps.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.26, 0.2, 0.24)
- m.Offset = Vector3.new(0, 0, 0.2)
- m.Parent = ps
- local w = Instance.new("Weld")
- w.Part0 = ps
- w.Part1 = pm
- if magazine.Value ~= 0 then
- w.C0 = CFrame.new(0, 0.4, 0.06)
- else
- w.C0 = CFrame.new(0, 0.1, 0.06)
- end
- w.C1 = CFrame.new()
- w.Parent = ps
- local p = Instance.new("Part")
- p.Name = "SlideBottom"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.26, 0.9, 0.16)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, -0.35, -0.06)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "GuideBottom"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.22, 0.5, 0.22)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, 0.2, -0.04)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Guide"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.22, 0.5, 0.22)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, 0.2, 0.01)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Slide1"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.13, 0.6, 0.24)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0.065, -0.2, 0)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Slide2"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.26, 0.6, 0.12)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, -0.2, -0.03)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Slide3"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.26, 0.45, 0.24)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, -0.58, 0)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Slide3"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("SpecialMesh")
- m.MeshType = "Brick"
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.33, 0.18, 0.22)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, -0.64, -0.01)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Shell"
- p.formFactor = "Custom"
- p.Size = Vector3.new(0.2, 0.26, 0.2)
- p.BrickColor = BrickColor.new("New Yeller")
- if magazine.Value ~= 0 then
- p.Transparency = 0
- else
- p.Transparency = 1
- end
- p.Reflectance = 0
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Scale = Vector3.new(0.4, 1, 0.4)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, -0.07, 0.07)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "RearSight"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.08, 0.08, 0.08)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0.07, -0.7, 0.12)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "RearSight"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = SC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.04, 0.084, 0.04)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0.07, -0.705, 0.12)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "RearSight"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = SC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.04, 0.084, 0.04)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(-0.07, -0.705, 0.12)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "RearSight"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.08, 0.08, 0.08)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(-0.07, -0.7, 0.12)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "FrontSight"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = MC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("BlockMesh")
- m.Name = "Mesh"
- m.Scale = Vector3.new(0.08, 0.08, 0.08)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, 0.35, 0.12)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "FrontSight"
- p.CanCollide = false
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = SC
- p.Reflectance = MR
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Scale = Vector3.new(0.04, 0.084, 0.04)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = ps
- w.C0 = CFrame.new(0, 0.346, 0.12)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Hole"
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = BrickColor.new("Really black")
- p.Reflectance = 0
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Scale = Vector3.new(0.09, 0.901, 0.09)
- m.Offset = Vector3.new(0, 0.34, 0)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.75, 0.07)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- if silenced == false then
- p.Name = "Muzzle"
- else
- p.Name = "Muzzle 2"
- end
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = BrickColor.new("Really red")
- p.Reflectance = 0.06
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Scale = Vector3.new(0.11, 0.9, 0.11)
- m.Offset = Vector3.new(0, 0.34, 0)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 0.75, 0.07)
- w.C1 = CFrame.new()
- w.Parent = p
- local s = Instance.new("Smoke")
- s.Enabled = false
- s.Name = "Smoke"
- s.RiseVelocity = -5
- s.Opacity = 0.3
- s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
- s.Size = 1
- s.Parent = p
- local f = Instance.new("Fire")
- f.Enabled = false
- f.Name = "Fire"
- f.Heat = -35
- f.Size = 1
- f.Parent = p
- p.Touched:connect(function(hit) onTouched(hit, p, "pistol") end)
- local p = Instance.new("Part")
- if silenced == false then
- p.Name = "Silencer"
- p.Transparency = 1
- else
- p.Name = "Muzzle"
- p.Transparency = 0
- end
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = BrickColor.new("Really black")
- p.Reflectance = 0
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Scale = Vector3.new(0.2, 0.8, 0.2)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 1.26, 0.07)
- w.C1 = CFrame.new()
- w.Parent = p
- local p = Instance.new("Part")
- p.Name = "Silencer1"
- if silenced == false then
- p.Transparency = 1
- else
- p.Transparency = 0
- end
- p.formFactor = "Symmetric"
- p.Size = Vector3.new(1, 1, 1)
- p.BrickColor = BrickColor.new("Really red")
- p.Reflectance = 0
- p.CanCollide = false
- p.Locked = true
- p.TopSurface = 0
- p.BottomSurface = 0
- p.Parent = model
- local m = Instance.new("CylinderMesh")
- m.Scale = Vector3.new(0.21, 0.6, 0.21)
- m.Parent = p
- local w = Instance.new("Weld")
- w.Part0 = p
- w.Part1 = pm
- w.C0 = CFrame.new(0, 1.26, 0.07)
- w.C1 = CFrame.new()
- w.Parent = p
- return model
- end
- function removeParts(format)
- if format == "RightHand" then
- pcall(function() Player.Character[Name]:Remove() end)
- elseif format == "LeftHand" then
- pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
- elseif format == "RightHolster" then
- pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
- elseif format == "LeftHolster" then
- pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
- end
- end
- function onTouched(hit, source, format)
- if format == "pistol" then
- if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent ~= Player.Character then
- tagHumanoid(hit.Parent.Humanoid)
- if canHit == true and melee == true then
- hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 50
- Player.Character[Name].Handle.Impact:Play()
- hit.Parent.Humanoid.Sit = true
- melee = false
- wait(0.8)
- melee = true
- end
- delay(3, function() untagHumanoid(hit.Parent.Humanoid) end)
- end
- end
- end
- function SetAngle(Joint, Angle, Character)
- if Character == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- if Joints[Joint] == nil then return false end
- if Joint == 1 or Joint == 3 then
- Joints[Joint].DesiredAngle = Angle
- end
- if Joint == 2 or Joint == 4 then
- Joints[Joint].DesiredAngle = -Angle
- end
- end
- function ForceAngle(Joint, Angle, Character)
- if Character == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- if Joints[Joint] == nil then return false end
- if Joint == 1 or Joint == 3 then
- Joints[Joint].DesiredAngle = Angle
- Joints[Joint].CurrentAngle = Angle
- end
- if Joint == 2 or Joint == 4 then
- Joints[Joint].DesiredAngle = -Angle
- Joints[Joint].CurrentAngle = -Angle
- end
- end
- function SetSpeed(Joint, Speed, Character)
- if Character == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- if Joints[Joint] == nil then return false end
- Joints[Joint].MaxVelocity = Speed
- end
- function DisableLimb(Limb, Character)
- if Character == nil then return false end
- if Character:FindFirstChild("Torso") == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder"),
- Character.Torso:FindFirstChild("Left Shoulder"),
- Character.Torso:FindFirstChild("Right Hip"),
- Character.Torso:FindFirstChild("Left Hip")
- }
- local Limbs = {
- Character:FindFirstChild("Right Arm"),
- Character:FindFirstChild("Left Arm"),
- Character:FindFirstChild("Right Leg"),
- Character:FindFirstChild("Left Leg")
- }
- if Joints[Limb] == nil then return false end
- if Limbs[Limb] == nil then return false end
- local Joint = Instance.new("Motor")
- Joint.Parent = Character.Torso
- Joint.Part0 = Character.Torso
- Joint.Part1 = Limbs[Limb]
- if Limb == 1 then
- Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.Name = "Right Shoulder 2"
- elseif Limb == 2 then
- Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.Name = "Left Shoulder 2"
- elseif Limb == 3 then
- Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joint.Name = "Right Hip 2"
- elseif Limb == 4 then
- Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joint.Name = "Left Hip 2"
- end
- Joint.MaxVelocity = Joints[Limb].MaxVelocity
- Joint.CurrentAngle = Joints[Limb].CurrentAngle
- Joint.DesiredAngle = Joints[Limb].DesiredAngle
- Joints[Limb]:Remove()
- end
- function ResetLimbCFrame(Limb, Character)
- if Character == nil then return false end
- if Character.Parent == nil then return false end
- if Character:FindFirstChild("Torso") == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- local Limbs = {
- Character:FindFirstChild("Right Arm"),
- Character:FindFirstChild("Left Arm"),
- Character:FindFirstChild("Right Leg"),
- Character:FindFirstChild("Left Leg")
- }
- if Joints[Limb] == nil then return false end
- if Limbs[Limb] == nil then return false end
- if Limb == 1 then
- Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- elseif Limb == 2 then
- Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- elseif Limb == 3 then
- Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- elseif Limb == 4 then
- Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
- end
- end
- function EnableLimb(Limb, Character)
- if Character == nil then return false end
- if Character:FindFirstChild("Torso") == nil then return false end
- local Joints = {
- Character.Torso:FindFirstChild("Right Shoulder 2"),
- Character.Torso:FindFirstChild("Left Shoulder 2"),
- Character.Torso:FindFirstChild("Right Hip 2"),
- Character.Torso:FindFirstChild("Left Hip 2")
- }
- local Limbs = {
- Character:FindFirstChild("Right Arm"),
- Character:FindFirstChild("Left Arm"),
- Character:FindFirstChild("Right Leg"),
- Character:FindFirstChild("Left Leg")
- }
- if Joints[Limb] == nil then return false end
- if Limbs[Limb] == nil then return false end
- if Limb == 1 then
- Joints[Limb].Name = "Right Shoulder"
- elseif Limb == 2 then
- Joints[Limb].Name = "Left Shoulder"
- elseif Limb == 3 then
- Joints[Limb].Name = "Right Hip"
- elseif Limb == 4 then
- Joints[Limb].Name = "Left Hip"
- end
- Animate = Character:FindFirstChild("Animate")
- if Animate == nil then return false end
- Animate = Animate:Clone()
- Character.Animate:Remove()
- Animate.Parent = Character
- end
- function playAnimation(format, mouse)
- if format == "equip" then
- Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
- local w = Instance.new("Weld")
- w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
- w.Part1 = Player.Character:FindFirstChild("Right Arm")
- w.C0 = CFrame.new(0, 1.2, 0.7)
- w.C1 = CFrame.new()
- w.Parent = Player.Character[Name.. " (Holstered)"].Handle
- for i = 0.01, 1, 0.1 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
- wait()
- else return false end
- else return false end
- end
- return playAnimation("hold")
- end
- if format == "rightEquip" then
- Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
- local w = Instance.new("Weld")
- w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
- w.Part1 = Player.Character:FindFirstChild("Right Arm")
- w.C0 = CFrame.new(0, 1.2, 0.7)
- w.C1 = CFrame.new()
- w.Parent = Player.Character[Name.. " (Holstered)"].Handle
- for i = 0.01, 1, 0.1 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
- wait()
- else return false end
- else return false end
- end
- return playAnimation("rightHold")
- end
- if format == "leftEquip" then
- Player.Character[Name.. " (Holstered, Left)"].Handle.Weld:Remove()
- local w = Instance.new("Weld")
- w.Part0 = Player.Character[Name.. " (Holstered, Left)"].Handle
- w.Part1 = Player.Character:FindFirstChild("Left Arm")
- w.C0 = CFrame.new(0, 1.2, 0.7)
- w.C1 = CFrame.new()
- w.Parent = Player.Character[Name.. " (Holstered, Left)"].Handle
- for i = 0.01, 1, 0.1 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0)
- wait()
- else return false end
- else return false end
- end
- return playAnimation("leftHold")
- end
- if format == "unequip" then
- for i = 1, 0.01, -0.1 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
- wait()
- else return false end
- else return false end
- end
- return true
- end
- if format == "leftUnequip" then
- for i = 1, 0.01, -0.1 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0)
- wait()
- else return false end
- else return false end
- end
- return true
- end
- if format == "rightUnequip" then
- for i = 1, 0.01, -0.1 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
- wait()
- else return false end
- else return false end
- end
- return true
- end
- if format == "hold" then
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
- else return false end
- else return false end
- end
- if format == "rightHold" then
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad(-5))
- else return false end
- else return false end
- end
- if format == "leftHold" then
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), math.rad(5))
- else return false end
- else return false end
- end
- if format == "reload" then
- coroutine.wrap(function()
- Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.7, 0.68)
- for i = 0, 30, 15 do
- pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
- wait()
- end
- pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-30), 0, 0) end)
- end)()
- Player.Character[Name].Handle.Empty:Play()
- for i = 0, 25, 7.5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5 + (i * 0.025), 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5 + (i * 0.8)), 0)
- wait()
- else return false end
- else return false end
- end
- Player.Character[Name].Handle.Release:Play()
- Player.Character[Name].Shell.Transparency = 1
- Player.Character[Name].Magazine.Transparency = 1
- CamShake(15, 50000)
- local magazineDrop = Player.Character[Name].Magazine:Clone()
- magazineDrop.Transparency = 0
- magazineDrop.Parent = game:GetService("Workspace")
- coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop)
- delay(0.1, function() magazineDrop.CanCollide = true end)
- Player.Character[Name].Handle.Reload:Play()
- local magazineNew = Player.Character[Name].Magazine:Clone()
- magazineNew.Name = "New Magazine"
- magazineNew.Transparency = 0
- magazineNew.Parent = Player.Character[Name]
- local w = Instance.new("Weld")
- w.Part0 = magazineNew
- w.Part1 = Player.Character:FindFirstChild("Left Arm")
- w.C0 = CFrame.new(0, 1.1, 0)
- w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
- w.Parent = magazineNew
- for i = 25, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (i / 50), 0.75 - (i / 50), 0.35 + (i / 22.5)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (i * 2)), math.rad(-i * 3.5), math.rad(-90))
- wait()
- else return false end
- else return false end
- end
- Player.Character[Name].Magazine.Transparency = 0
- Player.Character[Name].Shell.Transparency = 0
- Player.Character[Name]["New Magazine"]:Remove()
- for i = 25, 0, -7.5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5 + (i * 0.025), 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5 + (i * 0.8)), 0)
- wait()
- else return false end
- else return false end
- end
- coroutine.wrap(function()
- Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)
- for i = 30, 0, -15 do
- pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
- wait()
- end
- pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) end)
- end)()
- for i = 0, 10, 5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i), math.rad(-90))
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- if magazine.Value == 0 then
- wait(0.02)
- Player.Character[Name].Handle.Lock.Pitch = 1.5
- Player.Character[Name].Handle.Lock:Play()
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
- CamShake(1, 50000)
- CamShake(1, -50000)
- wait(0.02)
- else end
- for i = 10, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i), math.rad(-90))
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- wait(0.04)
- end
- if format == "reloadDual" then
- for i = 0, 25, 7.5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- coroutine.wrap(function()
- Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1)
- Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1)
- for i = 0, 360, 15 do
- pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
- pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
- wait()
- end
- pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end)
- pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end)
- end)()
- if magazine.Value == 0 then
- Player.Character[Name].Shell.Transparency = 1
- Player.Character[Name.. " (Left)"].Shell.Transparency = 1
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- else end
- wait(0.1)
- CamShake(1, 40000)
- Player.Character[Name].Handle.Release:Play()
- Player.Character[Name].Magazine.Transparency = 1
- local magazineDrop = Player.Character[Name].Magazine:Clone()
- magazineDrop.Transparency = 0
- magazineDrop.Parent = game:GetService("Workspace")
- coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop)
- delay(0.1, function() magazineDrop.CanCollide = true end)
- wait(math.random(0.1, 0.25))
- Player.Character[Name].Handle.Release:Play()
- Player.Character[Name.. " (Left)"].Magazine.Transparency = 1
- local magazineDropDual = Player.Character[Name.. " (Left)"].Magazine:Clone()
- magazineDropDual.Transparency = 0
- magazineDropDual.Parent = game:GetService("Workspace")
- coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDropDual)
- delay(0.1, function() magazineDropDual.CanCollide = true end)
- for i = 0, 25, 7.5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- local magazineNew = Player.Character[Name].Magazine:Clone()
- magazineNew.Name = "New Magazine"
- magazineNew.Transparency = 0
- magazineNew.Parent = Player.Character[Name]
- local w = Instance.new("Weld")
- w.Part0 = magazineNew
- w.Part1 = Player.Character:FindFirstChild("Right Arm")
- w.C0 = CFrame.new(0, 1.1, 0)
- w.C1 = CFrame.new()
- w.Parent = magazineNew
- local magazineNewL = Player.Character[Name.. " (Left)"].Magazine:Clone()
- magazineNewL.Name = "New Magazine L"
- magazineNewL.Transparency = 0
- magazineNewL.Parent = Player.Character[Name.. " (Left)"]
- local w = Instance.new("Weld")
- w.Part0 = magazineNewL
- w.Part1 = Player.Character:FindFirstChild("Left Arm")
- w.C0 = CFrame.new(0, 1.1, 0)
- w.C1 = CFrame.new()
- w.Parent = magazineNewL
- for i = 125, 0, -15 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- Player.Character[Name].Handle.Reload:Play()
- Player.Character[Name].Magazine.Transparency = 0
- Player.Character[Name].Shell.Transparency = 0
- Player.Character[Name.. " (Left)"].Magazine.Transparency = 0
- Player.Character[Name.. " (Left)"].Shell.Transparency = 0
- Player.Character[Name]["New Magazine"]:Remove()
- Player.Character[Name.. " (Left)"]["New Magazine L"]:Remove()
- Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)
- Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)
- for i = 0, 125, 15 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- if magazine.Value == 0 then
- Player.Character[Name].Handle.Lock.Pitch = 1.5
- Player.Character[Name].Handle.Lock:Play()
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
- Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
- CamShake(1, 30000)
- CamShake(1, -30000)
- else end
- for i = 25, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- playAnimation("rightHold")
- playAnimation("leftHold")
- return true
- end
- if format == "fire" then
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
- if silenced then
- Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
- Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
- Player.Character[Name].Handle.Fire2:Play()
- CamShake(15, 50000)
- else
- Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
- Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
- Player.Character[Name].Handle.Fire:Play()
- CamShake(15, 50000)
- end
- else return false end
- if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
- if silenced == false then
- coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
- else end
- else return false end
- for i = 0, 10, 5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
- if magazine.Value ~= 0 then
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
- elseif magazine.Value == 0 then
- Player.Character[Name].Handle.Lock.Pitch = 3
- Player.Character[Name].Shell.Transparency = 1
- Player.Character[Name].Handle.Lock:Play()
- end
- for i = 10, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
- wait()
- else return false end
- else return false end
- end
- end
- if format == "rightFire" then
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
- if silenced then
- Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
- Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
- Player.Character[Name].Handle.Fire2:Play()
- CamShake(15, 50000)
- else
- Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
- Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
- Player.Character[Name].Handle.Fire:Play()
- CamShake(15, 50000)
- end
- else return false end
- if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
- if silenced == false then
- coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
- else end
- else return false end
- for i = 0, 10, 5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), math.rad(-5))
- wait()
- else return false end
- else return false end
- end
- makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
- if magazine.Value ~= 0 then
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
- elseif magazine.Value == 0 then
- Player.Character[Name].Handle.Lock.Pitch = 3
- Player.Character[Name].Handle.Lock:Play()
- Player.Character[Name].Shell.Transparency = 1
- Player.Character[Name.. " (Left)"].Shell.Transparency = 1
- Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- end
- for i = 10, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), math.rad(-5))
- wait()
- else return false end
- else return false end
- end
- end
- if format == "leftFire" then
- Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") ~= nil then
- if silenced then
- Player.Character[Name.. " (Left)"].Handle.Fire2.Volume = math.random(3, 8) / 10
- Player.Character[Name.. " (Left)"].Handle.Fire2.Pitch = math.random(1.8, 2)
- Player.Character[Name.. " (Left)"].Handle.Fire2:Play()
- CamShake(15, 50000)
- else
- Player.Character[Name.. " (Left)"].Handle.Fire.Volume = math.random(8, 12) / 10
- Player.Character[Name.. " (Left)"].Handle.Fire.Pitch = math.random(25, 35) / 20
- Player.Character[Name.. " (Left)"].Handle.Fire:Play()
- CamShake(15, 50000)
- end
- end
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") ~= nil then
- if silenced == false then
- coroutine.resume(coroutine.create(function() Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = true Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = false Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = false end))
- else end
- end
- for i = 0, 10, 5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), math.rad(5))
- wait()
- else return false end
- else return false end
- end
- makeShell(Player.Character[Name.. " (Left)"]:FindFirstChild("ShellOut"))
- if magazine.Value ~= 0 then
- Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
- elseif magazine.Value == 0 then
- Player.Character[Name].Handle.Lock.Pitch = 3
- Player.Character[Name].Handle.Lock:Play()
- Player.Character[Name].Shell.Transparency = 1
- Player.Character[Name.. " (Left)"].Shell.Transparency = 1
- Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
- end
- for i = 10, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), math.rad(5))
- wait()
- else return false end
- else return false end
- end
- end
- if format == "whip" then
- Player.Character[Name].Handle.Melee:Play()
- for i = 0, 10, 5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i * 2), math.rad(-90))
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 - i * 3), 0)
- wait()
- else return false end
- else return false end
- end
- wait(0.1)
- for i = 0, 10, 5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0)
- wait()
- else return false end
- else return false end
- end
- for i = 10, 0, -5 do
- if Player.Character:FindFirstChild("Torso") ~= nil then
- if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
- Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0)
- Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
- Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i * 2), math.rad(-90))
- wait()
- else return false end
- else return false end
- end
- if dual ~= true then
- playAnimation("hold")
- return true
- else
- playAnimation("rightHold")
- playAnimation("leftHold")
- return true
- end
- end
- return true
- end
- function CamShake(time, freq)
- coroutine.resume(coroutine.create(function()
- local cam = game:GetService("Workspace").CurrentCamera
- local time = 10
- local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
- if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
- if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
- cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
- for i = 1, time do
- cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
- wait()
- end
- end))
- end
- function makeShell(part)
- if part == nil then return false end
- local casing = Instance.new("Part")
- casing.Name = "Shell"
- casing.formFactor = "Custom"
- casing.Size = Vector3.new(0.2, 0.26, 0.2)
- casing.CFrame = CFrame.new(part.Position) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
- casing.BrickColor = BrickColor.new("New Yeller")
- local mesh = Instance.new("CylinderMesh")
- mesh.Scale = Vector3.new(0.4, 1, 0.4)
- mesh.Parent = casing
- casing.Parent = game:GetService("Workspace")
- casing:BreakJoints()
- casing.Velocity = (part.CFrame.lookVector * 50) + Vector3.new(0, 10, 0)
- coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
- end
- function Weld(x, y)
- local weld = Instance.new("Weld")
- weld.Part0 = x
- weld.Part1 = y
- CJ = CFrame.new(x.Position)
- C0 = x.CFrame:inverse() * CJ
- C1 = y.CFrame:inverse() * CJ
- weld.C0 = C0
- weld.C1 = C1
- weld.Parent = x
- end
- function tagHumanoid(humanoid)
- local tag = Instance.new("ObjectValue")
- tag.Name = "creator"
- tag.Value = Player
- tag.Parent = humanoid
- local tag = Instance.new("StringValue")
- tag.Name = "creatorType1"
- tag.Value = Name
- tag.Parent = humanoid
- local tag = Instance.new("StringValue")
- tag.Name = "creatorType2"
- tag.Value = "shot"
- tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:FindFirstChild("creator")
- if tag ~= nil then
- tag:Remove()
- end
- local tag = humanoid:FindFirstChild("creatorType1")
- if tag ~= nil then
- tag:Remove()
- end
- local tag = humanoid:FindFirstChild("creatorType2")
- if tag ~= nil then
- tag:Remove()
- end
- end
- end
- function fire(startPoint, endPoint, hit)
- local trail = Instance.new("Part")
- trail.Name = "Bullet Trail"
- trail.BrickColor = BrickColor.new("Dark stone grey")
- trail.TopSurface = 0
- trail.BottomSurface = 0
- trail.formFactor = 0
- trail.Size = Vector3.new(1, 1, 1)
- trail.Transparency = 0.5
- trail.Anchored = true
- trail.CanCollide = false
- trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
- trail.Parent = game:GetService("Workspace")
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = "Brick"
- mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
- mesh.Parent = trail
- coroutine.resume(coroutine.create(function(part) for i = 1, 10 do part.Mesh.Scale = Vector3.new(part.Mesh.Scale.x - 0.01, part.Mesh.Scale.y - 0.01, part.Mesh.Scale.z) wait() end part:Remove() end), trail)
- if hit ~= nil then
- if hit.Parent == nil then return end
- if hit.Parent.ClassName == "Hat" then
- if hit.Parent.Parent.Humanoid ~= nil then
- hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
- end
- end
- if hit.Parent:FindFirstChild("Humanoid") ~= nil then
- tagHumanoid(hit.Parent.Humanoid)
- if hit.Name == "Head" then
- hit.Parent.Humanoid:TakeDamage(damage * 10)
- elseif hit.Name == "Torso" then
- hit.Parent.Humanoid:TakeDamage(damage * 2)
- elseif hit.Name == "Left Leg" then
- hit.Parent.Humanoid:TakeDamage(damage)
- hit.Parent.Humanoid.Sit = true
- elseif hit.Name == "Right Leg" then
- hit.Parent.Humanoid:TakeDamage(damage)
- hit.Parent.Humanoid.Sit = true
- else
- hit.Parent.Humanoid:TakeDamage(damage)
- end
- if math.random(1, 10) == 1 then
- hit.Parent.Humanoid.Sit = true
- end
- delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
- end
- if hit.Anchored == false then
- hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
- end
- end
- end
- function onButton1Down(mouse)
- if selected == false then return end
- if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and canFire == true and (function() if dual == true then if Player.Character:FindFirstChild(Name.. " (Left)") ~= nil then return true else return false end else return true end end)() == true then
- if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
- if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
- if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
- if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
- mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
- Button1Down = true
- canFire = false
- canFire2 = true
- while canFire2 == true do
- local humanoid = Player.Character:FindFirstChild("Humanoid")
- if humanoid == nil then
- canFire2 = false
- break
- end
- if humanoid.Health <= 0 then
- canFire2 = false
- break
- end
- local fireLeft = false
- if automatic == false and burst == false then
- canFire2 = false
- elseif automatic == false and burst == true then
- if burstCount >= burstCountMax then
- canFire2 = false
- burstCount = 0
- break
- end
- burstCount = burstCount + 1
- elseif automatic == true and burst == false then
- fireLeft = true
- end
- if magazine.Value > 0 then
- magazine.Value = magazine.Value - 1
- updateGui()
- if silenced == true then
- CamShake(1, Spread)
- else end
- fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
- coroutine.resume(coroutine.create(function()
- if dual == true then
- playAnimation("rightFire")
- elseif dual == false then
- playAnimation("fire")
- end
- end))
- if dual == true and magazine.Value ~= 0 then
- magazine.Value = magazine.Value - 1
- updateGui()
- wait(math.random(0, 0.15))
- fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
- coroutine.resume(coroutine.create(function()
- playAnimation("leftFire")
- end))
- end
- else
- Player.Character[Name].Handle.Empty:Play()
- end
- if fireLeft == true and dual == true and automatic == true then
- if magazine.Value > 0 then
- coroutine.resume(coroutine.create(function()
- wait(readyTime / 2)
- magazine.Value = magazine.Value - 1
- updateGui()
- fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
- if silenced == true then
- CamShake(1, Spread)
- else end
- playAnimation("leftFire")
- end))
- else
- coroutine.resume(coroutine.create(function()
- wait(readyTime / 2)
- Player.Character[Name].Handle.Empty:Play()
- end))
- end
- end
- wait(readyTime)
- end
- if magazine.Value ~= 0 then
- mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
- else end
- canFire = true
- end
- end
- function onButton1Up(mouse)
- if selected == false then return end
- Button1Down = false
- canFire2 = false
- burstCount = 0
- while canFire == false do wait() end
- if dual == true and automatic == false then
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
- mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
- canFire = false
- canFire2 = true
- while canFire2 == true do
- local humanoid = Player.Character:FindFirstChild("Humanoid")
- if humanoid == nil then
- canFire2 = false
- break
- end
- if humanoid.Health <= 0 then
- canFire2 = false
- break
- end
- if burst == false then
- canFire2 = false
- elseif burst == true then
- if burstCount >= burstCountMax then
- canFire2 = false
- burstCount = 0
- break
- end
- burstCount = burstCount + 1
- end
- if magazine.Value <= 0 then
- Player.Character[Name].Handle.Empty:Play()
- else end
- end
- if magazine.Value ~= 0 then
- mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
- else end
- canFire = true
- end
- end
- function onKeyDown(key, mouse)
- if selected == false then return end
- key = key:lower()
- if key == "q" and Button1Down == false and canFire == true then
- if mouse.Target == nil then return end
- if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
- if dual == true then onKeyDown("t", mouse) end
- onDeselected(mouse)
- removeParts("RightHolster")
- script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
- end
- end
- if key == "e" and Button1Down == false and canFire == true and canSilence == true then
- if silenced then
- silenced = false
- Player.Character[Name].Handle.Lock.Pitch = 5
- Player.Character[Name].Handle.Lock:Play()
- if Player.Character:FindFirstChild(Name) == nil then return end
- if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
- if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
- Player.Character[Name].Muzzle.Transparency = 1
- Player.Character[Name].Silencer1.Transparency = 1
- Player.Character[Name].Muzzle.Name = "Silencer"
- Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
- if dual == true then
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
- Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
- Player.Character[Name.. " (Left)"].Silencer1.Transparency = 1
- Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
- Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
- end
- else
- silenced = true
- Player.Character[Name].Handle.Lock.Pitch = 5
- Player.Character[Name].Handle.Lock:Play()
- if Player.Character:FindFirstChild(Name) == nil then return end
- if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
- if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
- Player.Character[Name].Silencer.Transparency = 0
- Player.Character[Name].Silencer1.Transparency = 0
- Player.Character[Name].Muzzle.Name = "Muzzle 2"
- Player.Character[Name].Silencer.Name = "Muzzle"
- if dual == true then
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
- if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
- Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
- Player.Character[Name.. " (Left)"].Silencer1.Transparency = 0
- Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
- Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
- end
- end
- end
- if key == "r" and Button1Down == false and canFire == true then
- if ammo.Value > 0 and magazine.Value ~= magazineMax.Value + Chamber then
- canFire = false
- burstCount = 0
- mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
- if magazine.Value > 0 then magazine.Value = Chamber end
- updateGui()
- if dual == true then
- playAnimation("reloadDual")
- elseif dual == false then
- playAnimation("reload")
- end
- if ammo.Value - magazineMax.Value < 0 then
- magazine.Value = ammo.Value
- ammo.Value = 0
- elseif ammo.Value - magazineMax.Value >= 0 then
- ammo.Value = ammo.Value - magazineMax.Value
- magazine.Value = magazine.Value + MagSize
- end
- updateGui()
- mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
- canFire = true
- end
- end
- if key == "t" and Button1Down == false and canFire == true and canDual == true then
- canFire = false
- if dual == false then
- local weapon = nil
- for _, p in pairs(Player.Backpack:GetChildren()) do
- if p.Name == Name and p ~= script.Parent then weapon = p break end
- end
- if weapon ~= nil then
- dual = true
- Chamber = 2
- MagSize = MagSize * 2
- weapon.Name = "Dual"
- weapon.Parent = script
- removeParts("RightHand")
- makeParts("RightHand")
- removeParts("RightHolster")
- makeParts("LeftHolster")
- playAnimation("leftEquip")
- removeParts("LeftHolster")
- makeParts("LeftHand")
- magazineMax.Value = math.ceil(magazineMax.Value * 2)
- ammoMax.Value = math.ceil(ammoMax.Value * 2)
- magazine.Value = magazine.Value + weapon.Magazine.Value
- ammo.Value = ammo.Value + weapon.Ammo.Value
- updateGui()
- end
- elseif dual == true then
- local weapon = script:FindFirstChild("Dual")
- if weapon ~= nil then
- dual = false
- Chamber = 1
- MagSize = MagSize * 0.5
- weapon.Name = Name
- weapon.Parent = Player.Backpack
- removeParts("RightHand")
- makeParts("RightHand")
- playAnimation("leftUnequip")
- removeParts("LeftHand")
- makeParts("RightHolster")
- playAnimation("hold")
- weapon.Magazine.Value = math.floor(magazine.Value / 2)
- weapon.Ammo.Value = math.floor(ammo.Value / 2)
- magazineMax.Value = math.ceil(magazineMax.Value / 2)
- ammoMax.Value = math.ceil(ammoMax.Value / 2)
- magazine.Value = math.ceil(magazine.Value / 2)
- ammo.Value = math.ceil(ammo.Value / 2)
- updateGui()
- end
- end
- canFire = true
- end
- if key == "y" and canZoom == true then
- if zoom == false then
- zoom = true
- local pos = mouse.Hit.p
- local target = mouse.Target
- local cam = game:GetService("Workspace").CurrentCamera
- focus = Instance.new("Part", workspace)
- focus.Anchored = true
- focus.CanCollide = false
- focus.Transparency = 1
- focus.TopSurface = 0
- focus.BottomSurface = 0
- focus.formFactor = "Plate"
- focus.Size = Vector3.new(0, 0, 0)
- focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
- cam.CameraSubject = focus
- cam.CameraType = "Attach"
- while zoom == true and selected == true do
- local set = false
- if target ~= nil then
- if target.Parent ~= nil then
- if target.Anchored == false then
- focus.CFrame = CFrame.new(target.CFrame.p) * (CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p) - CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p).p)
- set = true
- end
- end
- end
- if set == false then
- focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
- end
- wait()
- end
- if focus ~= nil then focus:Remove() focus = nil end
- local cam = game:GetService("Workspace").CurrentCamera
- cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
- cam.CameraType = "Custom"
- else
- zoom = false
- end
- end
- if key == "u" and Button1Down == false and canFire == true then
- if automatic == false and burst == false then
- if switchToBurst == true then
- burst = true
- local m = Instance.new("Message", Player)
- m.Text = "Burst"
- pcall(function() Player.Character[Name].Handle.Switch:Play() end)
- delay(2.5, function() m:Remove() end)
- elseif switchToAutomatic == true then
- automatic = true
- local m = Instance.new("Message", Player)
- m.Text = "Automatic"
- pcall(function() Player.Character[Name].Handle.Switch:Play() end)
- delay(2.5, function() m:Remove() end)
- end
- elseif automatic == false and burst == true then
- if switchToAutomatic == true then
- automatic = true
- burst = false
- local m = Instance.new("Message", Player)
- m.Text = "Automatic"
- pcall(function() Player.Character[Name].Handle.Switch:Play() end)
- delay(2.5, function() m:Remove() end)
- elseif switchToSingle == true then
- burst = false
- local m = Instance.new("Message", Player)
- m.Text = "Single"
- pcall(function() Player.Character[Name].Handle.Switch:Play() end)
- delay(2.5, function() m:Remove() end)
- end
- elseif automatic == true and burst == false then
- if switchToSingle == true then
- automatic = false
- local m = Instance.new("Message", Player)
- m.Text = "Single"
- pcall(function() Player.Character[Name].Handle.Switch:Play() end)
- delay(2.5, function() m:Remove() end)
- elseif switchToBurst == true then
- automatic = false
- burst = true
- local m = Instance.new("Message", Player)
- m.Text = "Burst"
- pcall(function() Player.Character[Name].Handle.Switch:Play() end)
- delay(2.5, function() m:Remove() end)
- end
- end
- end
- if key == "f" and canFire == true then
- canFire = false
- canHit = true
- playAnimation("whip")
- canHit = false
- wait(1)
- canFire = true
- end
- end
- function onSelected(mouse)
- if selected == true then return end
- selected = true
- canFire = false
- mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
- while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
- if Player.Character.WeaponActivated.Value == nil then break end
- if Player.Character.WeaponActivated.Value.Parent == nil then break end
- wait()
- end
- updateGui()
- local weapon = Instance.new("ObjectValue")
- weapon.Name = "WeaponActivated"
- weapon.Value = script.Parent
- weapon.Parent = Player.Character
- DisableLimb(1, Player.Character)
- DisableLimb(2, Player.Character)
- ForceAngle(1, 0, Player.Character)
- ForceAngle(2, 0, Player.Character)
- if dual == true then
- coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
- playAnimation("rightEquip")
- removeParts("LeftHolster")
- makeParts("LeftHand")
- else
- playAnimation("equip")
- end
- removeParts("RightHolster")
- makeParts("RightHand")
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- mouse.Button1Up:connect(function() onButton1Up(mouse) end)
- mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
- mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
- canFire = true
- end
- function onDeselected(mouse)
- if selected == false then return end
- Button1Down = false
- while canFire == false do
- wait()
- end
- selected = false
- if dual == true then
- if math.random(1, 2) == 1 then
- coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
- wait(math.random(1, 10) / 10)
- playAnimation("rightUnequip")
- else
- coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
- wait(math.random(1, 10) / 10)
- playAnimation("leftUnequip")
- end
- removeParts("LeftHand")
- makeParts("LeftHolster")
- else
- playAnimation("unequip")
- end
- removeParts("RightHand")
- makeParts("RightHolster")
- ForceAngle(1, 0, Player.Character)
- ForceAngle(2, 0, Player.Character)
- ResetLimbCFrame(1, Player.Character)
- ResetLimbCFrame(2, Player.Character)
- EnableLimb(1, Player.Character)
- EnableLimb(2, Player.Character)
- if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
- if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
- if Player.Character.WeaponActivated.Value == script.Parent then
- Player.Character.WeaponActivated:Remove()
- end
- end
- while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
- if Player.Character.WeaponActivated.Value == nil then break end
- if Player.Character.WeaponActivated.Value.Parent == nil then break end
- wait()
- end
- end
- if script.Parent.ClassName ~= "HopperBin" then
- if Player == nil then print("Error: Player not found!") return end
- Tool = Instance.new("HopperBin")
- Tool.Name = Name
- Tool.Parent = Player.Backpack
- script.Name = "Main"
- script.Parent = Tool
- end wait() if script.Parent.ClassName == "HopperBin" then
- while script.Parent.Parent.ClassName ~= "Backpack" do
- wait()
- end
- if script.Parent:FindFirstChild("MagazineMax") == nil then
- magazineMax = Instance.new("NumberValue")
- magazineMax.Name = "MagazineMax"
- magazineMax.Value = 20
- magazineMax.Parent = script.Parent
- else
- magazineMax = script.Parent.MagazineMax
- end
- if script.Parent:FindFirstChild("Magazine") == nil then
- magazine = Instance.new("NumberValue")
- magazine.Name = "Magazine"
- magazine.Value = 0
- magazine.Parent = script.Parent
- else
- magazine = script.Parent.Magazine
- end
- if script.Parent:FindFirstChild("AmmoMax") == nil then
- ammoMax = Instance.new("NumberValue")
- ammoMax.Name = "AmmoMax"
- ammoMax.Value = 4957438947673894
- ammoMax.Parent = script.Parent
- else
- ammoMax = script.Parent.AmmoMax
- end
- if script.Parent:FindFirstChild("Ammo") == nil then
- ammo = Instance.new("NumberValue")
- ammo.Name = "Ammo"
- ammo.Value = script.Parent.AmmoMax.Value
- ammo.Parent = script.Parent
- else
- ammo = script.Parent.Ammo
- end
- Player = script.Parent.Parent.Parent
- makeParts("RightHolster")
- script.Parent.Selected:connect(onSelected)
- script.Parent.Deselected:connect(onDeselected)
- end
- end
- end)
- TextBox.Parent = Frame
- TextBox.BackgroundColor3 = Color3.new(1, 1, 0.498039)
- TextBox.Position = UDim2.new(0, 6, 0, 258)
- TextBox.Size = UDim2.new(0, 200, 0, 50)
- TextBox.Font = Enum.Font.Garamond
- TextBox.FontSize = Enum.FontSize.Size24
- TextBox.Text = "Exploit Gui By Timmiy231Pro"
- TextBox.TextSize = 19
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement