Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Jump Two Time or press M
- --Down Press Q
- --Wings Spin Press A Two Time, Doesnt work maybe
- --Wings Spin Press D Two Time, Doesnt work maybe
- script.Parent = nil
- local Remote = script.Parent:WaitForChild("RemoteEvent")
- function fly()
- for i,v in pairs(script:GetChildren()) do
- pcall(function() v.Value = "" end)
- game:GetService("Debris"):AddItem(v,.1)
- end
- local 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 = {}
- local 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
- local function lerp(a,b,c)
- return a+(b-a)*c
- end
- local 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
- local 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
- local function tickwave(time,length,offset)
- return (math.abs((tick()+(offset or 0))%time-time/2)*2-time/2)/time/2*length
- end
- local 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 = {
- --antiboomz0r = {"Really black","Institutional white",0,0,false,Color3.new(1,1,.95),Color3.new(1,1,.6)},
- antiboomz0r = {"New Yeller",nil,0.4,0.7,true,Color3.new(1,1,.95),Color3.new(1,1,.6)},
- --antiboomz0r = {"Cyan","Toothpaste",0,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
- taart = {"Royal purple",nil,.4,.4,true},
- mitta = {"Black",nil,0,0,false},
- penjuin3 = {"White",nil,0,0,false},
- thepc8110 = {"Black","Bright red",.5,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
- nonspeaker = {"Cyan","Toothpaste",0,0,false,Color3.new(1,0,0),Color3.new(0,0,0)},
- littleau999 = {"Reddish brown",1030,0,0,false},
- unscripter = {"Really black","Really black",.2,0,true,Color3.new(0,0,0),Color3.new(0,0,0)},
- oxcool1 = {"Really black","White",.2,0,false,Color3.new(0,0,0),Color3.new(0,0,0)},
- krodmiss = {"Really black",nil,0,0,false},
- }
- local topcolor = invcol(char.Torso.BrickColor)
- local feacolor = char.Torso.BrickColor
- local ptrans = 0
- local pref = 0
- local fire = false
- 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
- local vel = Vector3.new()
- local cf = CFrame.new()
- local flspd = 0
- local keysdown = {}
- local keypressed = {}
- local ktime = {}
- local descendtimer = 0
- local jumptime = tick()
- hum.Jumping:connect(function()
- jumptime = tick()
- end)
- local cam = workspace.CurrentCamera
- local 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))
- local ku = plr:GetMouse().KeyUp:connect(function(key)
- keysdown[key] = false
- if key == " " then
- descendtimer = tick()
- end
- end)
- local function mid(a,b,c)
- return math.max(a,math.min(b,c or -a))
- end
- local function bn(a)
- return a and 1 or 0
- end
- local 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
- local idledir
- 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
- Remote:FireServer("Flying")
- local fldir = cam.CoordinateFrame:vectorToWorldSpace(Vector3.new(bn(keysdown.d)-bn(keysdown.a),0,bn(keysdown.s)-bn(keysdown.w))).unit
- local lfldir = fldir
- local lmoving = moving
- moving = fldir.magnitude > .1
- script.Parent.WingsMovement:FireServer("moving",moving)
- 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)
- script.Parent.AniTick:FireServer(ani)
- 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)
- --Dive anim or swing animation
- if gdown then
- script.Parent.WingsMovement:FireServer("gdown",gdown)
- --print("gdown")
- elseif dbomb then
- script.Parent.WingsMovement:FireServer("dbomb",dbomb)
- --print("dbomb")
- elseif divebomb then
- script.Parent.WingsMovement:FireServer("divebomb",divebomb)
- --print("divebomb")
- elseif veryhigh then
- script.Parent.WingsMovement:FireServer("veryhigh",veryhigh)
- --print("veryhigh")
- elseif flap1 then
- script.Parent.WingsMovement:FireServer("flap1",flap1)
- --print("flap")
- elseif outlow then
- script.Parent.WingsMovement:FireServer("outlow",outlow)
- elseif descending then
- script.Parent.WingsMovement:FireServer("descending",descending)
- --print("outlow")
- 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)
- script.Parent.AniTick:FireServer(ani)
- --print("Idle")
- -- setwings(idle,10)
- Remote:FireServer("Idle")
- --maybe idle
- local x,y,z = fspd/160,uspd/700,sspd/900
- if (keypressed["M"] or keypressed["m"]) 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()
- --Bird Wings By saud20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement