Advertisement
SmokeDelsin

you cant fly without wings

Jul 18th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.53 KB | None | 0 0
  1. local plr = game:service'Players'.LocalPlayer
  2. local m = plr:GetMouse()
  3. local char = plr.Character
  4. local runservice = game:service'RunService'
  5. local modelScale = 1/5
  6.  
  7.  
  8. pcall(function() local a = script.Parent.FaerieScript if a ~= script then a:Destroy() end end)
  9. pcall(function() local a = char.Animate if a ~= script then a.Disabled = true a:Destroy() end end)
  10. script.Name = "FaerieScript"
  11.  
  12. function weld(a,b,c,d)
  13. local w = Instance.new("Weld",a)
  14. w.Part0 = a
  15. w.Part1 = b
  16. w.C0 = c or CFrame.new()
  17. w.C1 = d or CFrame.new()
  18. return w
  19. end
  20.  
  21. function lerp(a,b,c)
  22. return a+(b-a)*c
  23. end
  24.  
  25. do -- Ignore my clerp stuff stolen from stravvy
  26. local function QuaternionFromCFrame(cf)
  27. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  28. local trace = m00 + m11 + m22
  29. if trace > 0 then
  30. local s = math.sqrt(1 + trace)
  31. local recip = 0.5/s
  32. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  33. else
  34. local i = 0
  35. if m11 > m00 then
  36. i = 1
  37. end
  38. if m22 > (i == 0 and m00 or m11) then
  39. i = 2
  40. end
  41. if i == 0 then
  42. local s = math.sqrt(m00-m11-m22+1)
  43. local recip = 0.5/s
  44. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  45. elseif i == 1 then
  46. local s = math.sqrt(m11-m22-m00+1)
  47. local recip = 0.5/s
  48. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  49. elseif i == 2 then
  50. local s = math.sqrt(m22-m00-m11+1)
  51. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  52. end
  53. end
  54. end
  55. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  56. local xs, ys, zs = x + x, y + y, z + z
  57. local wx, wy, wz = w*xs, w*ys, w*zs
  58. local xx = x*xs
  59. local xy = x*ys
  60. local xz = x*zs
  61. local yy = y*ys
  62. local yz = y*zs
  63. local zz = z*zs
  64. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  65. end
  66. local function QuaternionSlerp(a, b, t)
  67. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  68. local startInterp, finishInterp;
  69. if cosTheta >= 0.0001 then
  70. if (1 - cosTheta) > 0.0001 then
  71. local theta = math.acos(cosTheta)
  72. local invSinTheta = 1/math.sin(theta)
  73. startInterp = math.sin((1-t)*theta)*invSinTheta
  74. finishInterp = math.sin(t*theta)*invSinTheta
  75. else
  76. startInterp = 1-t
  77. finishInterp = t
  78. end
  79. else
  80. if (1+cosTheta) > 0.0001 then
  81. local theta = math.acos(-cosTheta)
  82. local invSinTheta = 1/math.sin(theta)
  83. startInterp = math.sin((t-1)*theta)*invSinTheta
  84. finishInterp = math.sin(t*theta)*invSinTheta
  85. else
  86. startInterp = t-1
  87. finishInterp = t
  88. end
  89. end
  90. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  91. end
  92. function clerp(a,b,t)
  93. local qa = {QuaternionFromCFrame(a)}
  94. local qb = {QuaternionFromCFrame(b)}
  95. local ax, ay, az = a.x, a.y, a.z
  96. local bx, by, bz = b.x, b.y, b.z
  97. local _t = 1-t
  98. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  99. end
  100. end
  101.  
  102.  
  103. Instance.new("Hat",char)
  104. local root = char.HumanoidRootPart
  105. local tw = root.RootJoint
  106. local tor = char.Torso
  107. local hd = char.Head
  108. local hum = char.Humanoid
  109. hum.Health = 40
  110. hum.MaxHealth = 40
  111. hum.WalkSpeed = 12
  112. local rl,ll = char["Right Leg"],char["Left Leg"]
  113. local ra,la = char["Right Arm"],char["Left Arm"]
  114.  
  115. local c0 = {
  116. rs = CFrame.new(1,.5,0),
  117. ls = CFrame.new(-1,.5,0),
  118. rh = CFrame.new(.5,-1,0),
  119. lh = CFrame.new(-.5,-1,0),
  120. nk = CFrame.new(0,1,0),
  121. tw = CFrame.new(0,0,0)*CFrame.Angles(0,0,0),
  122. }
  123. local c1 = {
  124. rs = CFrame.new(-.5,.5,0),
  125. ls = CFrame.new(.5,.5,0),
  126. rh = CFrame.new(0,1,0),
  127. lh = CFrame.new(0,1,0),
  128. nk = CFrame.new(0,-.5,0),
  129. tw = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  130. }
  131.  
  132. local rs = tor["Right Shoulder"]
  133. local ls = tor["Left Shoulder"]
  134. local rh = tor["Right Hip"]
  135. local lh = tor["Left Hip"]
  136. local nk = tor["Neck"]
  137. for i,v in pairs(tor:GetChildren()) do
  138. if v:IsA("Motor6D") then
  139. v.DesiredAngle = 0
  140. v.MaxVelocity = 0
  141. v.CurrentAngle = 0
  142. end
  143. end
  144.  
  145.  
  146.  
  147.  
  148. pcall(function() tor.roblox:Destroy() end)
  149.  
  150. pcall(function() char.Faerie:Destroy() end)
  151. local model = Instance.new("Model",char)
  152. model.Name = "Faerie"
  153.  
  154. local BasePart = Instance.new("Part")
  155. BasePart.CanCollide = false
  156. BasePart.Anchored = false
  157. BasePart.FormFactor = "Custom"
  158. BasePart.Locked = true
  159. BasePart.Size = Vector3.new()
  160. BasePart.TopSurface,BasePart.BottomSurface,BasePart.LeftSurface,BasePart.RightSurface,BasePart.FrontSurface,BasePart.BackSurface = 10,10,10,10,10,10
  161. BasePart:BreakJoints()
  162.  
  163. function NP(par)
  164. local p = BasePart:Clone()
  165. p.Parent = par or model
  166. return p
  167. end
  168.  
  169.  
  170. for i,v in pairs(char:GetChildren()) do
  171. if v:IsA("BasePart") then
  172. v.Material = "SmoothPlastic"
  173. v.TopSurface,v.BottomSurface,v.FrontSurface,v.BackSurface,v.LeftSurface,v.RightSurface = 10,10,10,10,10,10
  174. end
  175. end
  176.  
  177. do
  178. if modelScale ~= 1 then
  179. for i,v in pairs(c0) do
  180. c0[i] = (v-v.p) + v.p*modelScale
  181. end
  182. for i,v in pairs(c1) do
  183. c1[i] = (v-v.p) + v.p*modelScale
  184. end
  185. local Joints = {}
  186. local gtJoints,gtParts;
  187.  
  188. local function gtCFrame(cf)
  189. return (cf-cf.p) + cf.p * modelScale
  190. end
  191.  
  192. function gtJoints(p)
  193. for i,v in pairs(p:GetChildren()) do
  194. if v:IsA("JointInstance") then
  195. table.insert(Joints,{v,v.Part0,v.Part1})
  196. v.Part0 = nil
  197. v.Part1 = nil
  198. v.C0 = (v.C0-(v.C0.p)) + (v.C0.p * modelScale)
  199. v.C1 = (v.C1-(v.C1.p)) + (v.C1.p * modelScale)
  200. end
  201. gtJoints(v)
  202. end
  203. end
  204.  
  205. function gtParts(p)
  206. for i,v in pairs(p:GetChildren()) do
  207. if v:IsA("BasePart") then
  208. pcall(function() v.FormFactor = "Custom" end)
  209. local oldz = v.Size
  210. local cf = tor.CFrame:toObjectSpace(v.CFrame)
  211. v.Size = v.Size * modelScale
  212. v.CFrame = tor.CFrame * gtCFrame(cf)
  213. local mesh = nil
  214. for i,t in pairs(v:GetChildren()) do
  215. if t:IsA("DataModelMesh") then
  216. mesh = t
  217. end
  218. end
  219. if mesh == nil and v:IsA("Part") and v.Shape == Enum.PartType.Ball then
  220. mesh = Instance.new("SpecialMesh",v)
  221. mesh.MeshType = Enum.MeshType.Sphere
  222. end
  223. if mesh == nil and ((v:IsA("Part") and v.Shape == Enum.PartType.Block) or v:IsA("Seat") or v:IsA("VehicleSeat")) then
  224. mesh = Instance.new("BlockMesh",v)
  225. end
  226. if mesh ~= nil then
  227. if mesh:IsA("SpecialMesh") and mesh.MeshType == Enum.MeshType.FileMesh then
  228. mesh.Scale = mesh.Scale * modelScale
  229. else
  230. mesh.Scale = mesh.Scale*(oldz*modelScale)/v.Size
  231. end
  232. end
  233. end
  234. gtParts(v)
  235. end
  236. end
  237. gtJoints(char)
  238. gtParts(char)
  239. for i,v in pairs(Joints) do
  240. v[1].Part0 = v[2]
  241. v[1].Part1 = v[3]
  242. end
  243. end
  244. end
  245. rs.C0,rs.C1 = c0.rs,c1.rs
  246. ls.C0,ls.C1 = c0.ls,c1.ls
  247. rh.C0,rh.C1 = c0.rh,c1.rh
  248. lh.C0,lh.C1 = c0.lh,c1.lh
  249. nk.C0,nk.C1 = c0.nk,c1.nk
  250. tw.C0,tw.C1 = c0.tw,c1.tw
  251.  
  252. local w10,w20 = w1.C0,w2.C0
  253.  
  254. local pl = tor:FindFirstChild("FairyLight") or Instance.new("PointLight",tor)
  255. pl.Name = "FairyLight"
  256. pl.Shadows = false
  257. pl.Range = 8
  258. pl.Brightness = 10
  259.  
  260. local sparkles = tor:FindFirstChild("FairySparkles") or Instance.new("Sparkles",tor)
  261. sparkles.Name = "FairySparkles"
  262.  
  263.  
  264. local outfit = 0
  265. local outfitparts = {ra,la,rl,ll,tor}
  266. local outfits = {
  267. {{106705109},{106705077},{106703301},{106703213},{106705037}}
  268. }
  269.  
  270.  
  271. local mycolor = ll.BrickColor.Color
  272. local mycolor2 = mycolor
  273.  
  274. function setOutfit()
  275. local of = outfits[outfit]
  276. if of then
  277. for i,v in pairs(outfitparts) do
  278. local mesh = v:FindFirstChild("outfitMesh")
  279. local meshdata = outfits[outfit][i]
  280. if not mesh then
  281. mesh = Instance.new("SpecialMesh",v)
  282. mesh.Name = "outfitMesh"
  283. mesh.TextureId = "rbxassetid://9854798"
  284. end
  285. mesh.Scale =(meshdata[2] or Vector3.new(1,1,1)) * modelScale
  286. mesh.MeshId = "rbxassetid://"..meshdata[1]
  287. mesh.VertexColor = Vector3.new(mycolor2.r,mycolor2.g,mycolor2.b)
  288. end
  289. else
  290. for i,v in pairs(outfitparts) do
  291. pcall(function() v.outfitMesh:Destroy() end)
  292. end
  293. end
  294. end
  295. setOutfit()
  296.  
  297. local senabled = true
  298. local lenabled = true
  299. function changeColor()
  300. for i,v in pairs(char:GetChildren()) do
  301. if v:IsA("BasePart") then
  302. v.BrickColor = BrickColor.new(mycolor)
  303. end
  304. end
  305. local mc1 = Vector3.new(mycolor.r,mycolor.g,mycolor.b)
  306. local mc2 = Vector3.new(mycolor2.r,mycolor2.g,mycolor2.b)
  307. w1m.VertexColor,w2m.VertexColor,hm.VertexColor = mc1,mc1,mc2
  308. for i,v in pairs(outfitparts) do
  309. local mesh = v:FindFirstChild("outfitMesh")
  310. if mesh then
  311. mesh.VertexColor = mc2
  312. end
  313. end
  314. pl.Color = mycolor
  315. sparkles.SparkleColor = mycolor
  316. end
  317. changeColor()
  318.  
  319. do
  320. pcall(function() plr.PlayerGui.fairyColoring:Destroy() end)
  321. local scr = Instance.new("ScreenGui",plr.PlayerGui)
  322. scr.Name = "fairyColoring"
  323. local fr = Instance.new("Frame",scr)
  324. fr.Size = UDim2.new(0,-150,0,-65)
  325. fr.BackgroundColor3 = Color3.new(1,1,1)
  326. fr.BorderColor3 = Color3.new(.05,.05,.05)
  327. fr.BackgroundTransparency = .8
  328. fr.Position = UDim2.new(1,0,1,scr.Parent:FindFirstChild("PandaHelpNotify") and -20 or 0)
  329. fr.ZIndex = 9
  330. local am = 75
  331. local rval,gval,bval = mycolor.r,mycolor.g,mycolor.b
  332. local r = Instance.new("TextButton",fr)
  333. r.BackgroundTransparency = 1
  334. r.Size = UDim2.new(0,75,0,15)
  335. r.Position = UDim2.new(0,5,0,5)
  336. r.TextColor3 = Color3.new(1,1,1)
  337. r.TextStrokeTransparency = .4
  338. for i=1,am do
  339. local t = Instance.new("ImageLabel",r)
  340. t.BorderSizePixel = 0
  341. t.Size = UDim2.new(1/am,0,1,0)
  342. t.Position = UDim2.new((i-1)/am,0,0,0)
  343. t.Name = i
  344. t.ZIndex = 10
  345. end
  346. local rb = Instance.new("ImageLabel",r)
  347. rb.ZIndex = 10
  348. rb.Size = UDim2.new(0,2,1,-2)
  349. rb.BackgroundColor3 = Color3.new(0,0,0)
  350. rb.BackgroundTransparency = .5
  351. rb.BorderColor3 = Color3.new(.4,.4,.4)
  352. rb.Name = "b"
  353. local g = r:Clone()
  354. g.Parent = fr
  355. g.Position = UDim2.new(0,5,0,25)
  356. local b = r:Clone()
  357. b.Parent = fr
  358. b.Position = UDim2.new(0,5,0,45)
  359. r.ZIndex,g.ZIndex,b.ZIndex = 10,10,10
  360. local prev = Instance.new("TextButton",fr)
  361. prev.Size = UDim2.new(0,55,0,45)
  362. prev.Position = UDim2.new(0,90,0,5)
  363. prev.ZIndex = 10
  364. prev.BorderColor3 = Color3.new(.2,.2,.2)
  365. prev.TextColor3 = Color3.new(1,1,1)
  366. prev.TextStrokeTransparency = .4
  367. prev.TextYAlignment = "Bottom"
  368. prev.FontSize = "Size8"
  369. prev.TextWrapped = true
  370. local res = Instance.new("TextButton",fr)
  371. res.Size = UDim2.new(0,55,0,9)
  372. res.Position = UDim2.new(0,90,0,51)
  373. res.ZIndex = 10
  374. res.BorderColor3 = Color3.new(.2,.2,.2)
  375. res.BackgroundColor3 = Color3.new(.5,0,0)
  376. res.TextColor3 = Color3.new(1,1,1)
  377. res.Text = "reset"
  378. res.FontSize = "Size8"
  379. local mode = 0
  380. local function update(set)
  381. r.b.Position = UDim2.new(rval,-1,0,1)
  382. g.b.Position = UDim2.new(gval,-1,0,1)
  383. b.b.Position = UDim2.new(bval,-1,0,1)
  384. local col = Color3.new(rval,gval,bval)
  385. prev.BackgroundColor3 = mode == 1 and mycolor2 or mycolor
  386. prev.Text = ""
  387. r.Text = math.floor(rval*255+.5)
  388. g.Text = math.floor(gval*255+.5)
  389. b.Text = math.floor(bval*255+.5)
  390. for i,v in pairs(r:GetChildren()) do
  391. local n = tonumber(v.Name)
  392. if n then
  393. local sc = n/am
  394. v.BackgroundColor3 = Color3.new(sc,gval,bval)
  395. end
  396. end
  397. for i,v in pairs(g:GetChildren()) do
  398. local n = tonumber(v.Name)
  399. if n then
  400. local sc = n/am
  401. v.BackgroundColor3 = Color3.new(rval,sc,bval)
  402. end
  403. end
  404. for i,v in pairs(b:GetChildren()) do
  405. local n = tonumber(v.Name)
  406. if n then
  407. local sc = n/am
  408. v.BackgroundColor3 = Color3.new(rval,gval,sc)
  409. end
  410. end
  411. if set ~= false then
  412. if mode == 0 then
  413. mycolor = col
  414. end
  415. if mode == 1 then
  416. mycolor2 = col
  417. end
  418. changeColor()
  419. end
  420. end
  421. update()
  422. local rd,gd,bd = false,false,false
  423. r.MouseButton1Down:connect(function(x,y) rd = true rval = (x-r.AbsolutePosition.X)/r.AbsoluteSize.X update() end)
  424. r.MouseButton1Up:connect(function() rd = false end)
  425. r.MouseLeave:connect(function() rd = false end)
  426. r.MouseMoved:connect(function(x,y) if not rd then return end rval = (x-r.AbsolutePosition.X)/r.AbsoluteSize.X update() end)
  427. g.MouseButton1Down:connect(function(x,y) gd = true gval = (x-g.AbsolutePosition.X)/g.AbsoluteSize.X update() end)
  428. g.MouseButton1Up:connect(function() gd = false end)
  429. g.MouseLeave:connect(function() gd = false end)
  430. g.MouseMoved:connect(function(x,y) if not gd then return end gval = (x-g.AbsolutePosition.X)/g.AbsoluteSize.X update() end)
  431. b.MouseButton1Down:connect(function(x,y) bd = true bval = (x-b.AbsolutePosition.X)/b.AbsoluteSize.X update() end)
  432. b.MouseButton1Up:connect(function() bd = false end)
  433. b.MouseLeave:connect(function() bd = false end)
  434. b.MouseMoved:connect(function(x,y) if not bd then return end bval = (x-b.AbsolutePosition.X)/b.AbsoluteSize.X update() end)
  435. res.MouseButton1Click:connect(function()
  436. rval,gval,bval = themeColor.Color.r,themeColor.Color.g,themeColor.Color.b
  437. update()
  438. end)
  439.  
  440. local modebtn = Instance.new("TextButton",fr)
  441. modebtn.Position = UDim2.new(1,-150,0,-15)
  442. modebtn.Size = UDim2.new(0,49,0,14)
  443. modebtn.BackgroundColor3 = Color3.new(1,1,0)
  444. modebtn.BackgroundTransparency = .6
  445. modebtn.TextScaled = true
  446. modebtn.Font = 4
  447. modebtn.TextColor3 = Color3.new(1,1,1)
  448. modebtn.TextStrokeTransparency = .7
  449. modebtn.Text = "Body"
  450. modebtn.MouseButton1Click:connect(function()
  451. mode = (mode+1)%2
  452. local col = mode == 1 and mycolor2 or mycolor
  453. rval,gval,bval = col.r,col.g,col.b
  454. modebtn.Text = mode == 0 and "Body" or "Clothes"
  455. update(false)
  456. end)
  457.  
  458. local outfitbtn = Instance.new("TextButton",fr)
  459. outfitbtn.Position = UDim2.new(1,-150,0,-30)
  460. outfitbtn.Size = UDim2.new(0,49,0,14)
  461. outfitbtn.BackgroundColor3 = Color3.new(1,1,0)
  462. outfitbtn.BackgroundTransparency = .6
  463. outfitbtn.TextScaled = true
  464. outfitbtn.Font = 4
  465. outfitbtn.TextColor3 = Color3.new(1,1,1)
  466. outfitbtn.TextStrokeTransparency = .7
  467. outfitbtn.Text = "Outfit"
  468. outfitbtn.MouseButton1Click:connect(function()
  469. outfit = (outfit+1)%(#outfits+1)
  470. setOutfit()
  471. end)
  472.  
  473. local sparklebtn = Instance.new("TextButton",fr)
  474. sparklebtn.Position = UDim2.new(1,-100,0,-15)
  475. sparklebtn.Size = UDim2.new(0,100,0,14)
  476. sparklebtn.BackgroundColor3 = Color3.new(0,1,0)
  477. sparklebtn.BackgroundTransparency = .6
  478. sparklebtn.TextScaled = true
  479. sparklebtn.Font = 4
  480. sparklebtn.TextColor3 = Color3.new(1,1,1)
  481. sparklebtn.TextStrokeTransparency = .7
  482. sparklebtn.Text = "Sparkles"
  483. sparklebtn.MouseButton1Click:connect(function()
  484. senabled = not senabled
  485. sparklebtn.BackgroundColor3 = senabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  486. end)
  487. local lightbtn = Instance.new("TextButton",fr)
  488. lightbtn.Position = UDim2.new(1,-100,0,-30)
  489. lightbtn.Size = UDim2.new(0,100,0,14)
  490. lightbtn.BackgroundColor3 = Color3.new(0,1,0)
  491. lightbtn.BackgroundTransparency = .6
  492. lightbtn.TextScaled = true
  493. lightbtn.Font = 4
  494. lightbtn.TextColor3 = Color3.new(1,1,1)
  495. lightbtn.TextStrokeTransparency = .7
  496. lightbtn.Text = "Light"
  497. lightbtn.MouseButton1Click:connect(function()
  498. lenabled = not lenabled
  499. lightbtn.BackgroundColor3 = lenabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  500. end)
  501. end
  502.  
  503.  
  504. local gyro = root:FindFirstChild("RootGyro") or Instance.new("BodyGyro",root)
  505. gyro.maxTorque = Vector3.new()
  506. gyro.Name = "RootGyro"
  507.  
  508. local vel = root:FindFirstChild("RootVel") or Instance.new("BodyVelocity",root)
  509. vel.maxForce = Vector3.new()
  510. vel.Name = "RootVel"
  511. vel.P = 4000
  512.  
  513. local flying = false
  514. local state = "idle"
  515. local kd = {}
  516. local humspd = 0
  517. local flyspeed = 0
  518. local flystop = 0
  519. local sitting = false
  520. local holding = false
  521.  
  522. m.KeyDown:connect(function(k)
  523. local now = tick()
  524. kd[k] = now
  525. if k == " " and not flying then
  526. pcall(function() sitting:Destroy() end)
  527. sitting = nil
  528. state = "fly"
  529. flying = true
  530. flydir = (root.CFrame.lookVector*Vector3.new(1,0,1)).unit
  531. elseif k == " " and state == "fly" then
  532. flying = false
  533. state = "idle"
  534. flystop = tick()
  535. elseif k == "x" and m.Target and (root.Position-m.Hit.p).magnitude < 20*modelScale then
  536. local tar = m.Target
  537. local cf = tar.CFrame:toObjectSpace(m.Hit)
  538. local siz = tar.Size/2
  539. local cfr
  540. local rx,ry,rz = 0,0,0
  541. local lv = tar.CFrame:vectorToObjectSpace(root.CFrame.lookVector)
  542. if math.abs(cf.Y-siz.Y) < .03 then
  543. cfr = CFrame.new(cf.p + Vector3.new(0,3*modelScale,0)) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  544. elseif math.abs(-cf.Y-siz.Y) < .03 then
  545. cfr = CFrame.new(cf.p - Vector3.new(0,3*modelScale,0)) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),math.pi)
  546. elseif math.abs(cf.X-siz.X) < .03 then
  547. cfr = CFrame.new(cf.p + Vector3.new(3*modelScale,0,0)) * CFrame.Angles(0,0,-math.pi/2) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  548. elseif math.abs(-cf.X-siz.X) < .03 then
  549. cfr = CFrame.new(cf.p - Vector3.new(3*modelScale,0,0)) * CFrame.Angles(0,0,math.pi/2) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  550. elseif math.abs(cf.Z-siz.Z) < .03 then
  551. cfr = CFrame.new(cf.p + Vector3.new(0,0,3*modelScale)) * CFrame.Angles(math.pi/2,0,0) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  552. elseif math.abs(-cf.Z-siz.Z) < .03 then
  553. cfr = CFrame.new(cf.p - Vector3.new(0,0,3*modelScale)) * CFrame.Angles(-math.pi/2,0,0) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  554. end
  555. if cfr then
  556. pcall(function() sitting:Destroy() end)
  557. flying = false
  558. state = "sit"
  559. if m.Target.Anchored then
  560. sitting = {tar = tar, cf = cfr}
  561. else
  562. sitting = weld(tar,root,cfr)
  563. end
  564. end
  565. end
  566. end)
  567. m.KeyUp:connect(function(k)
  568. kd[k] = nil
  569. end)
  570.  
  571. hum.Running:connect(function(spd)
  572. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  573. humspd = spd
  574. state = flying and "fly" or (spd < 1 and "idle" or "walk")
  575. end)
  576. hum.Climbing:connect(function(spd)
  577. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  578. humspd = spd
  579. state = flying and "fly" or (spd < 1 and "idle" or "walk")
  580. end)
  581. hum.Seated:connect(function(a)
  582. state = a and "sit" or humspd > 0 and "idle" or "walk"
  583. end)
  584.  
  585. hum.Changed:connect(function()
  586. if hum.Jump then
  587. hum.Jump = false
  588. end
  589. end)
  590.  
  591. hum.FreeFalling:connect(function()
  592. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  593. state = math.abs(tor.Velocity.Y) > 1 and "inair" or state
  594. end)
  595.  
  596. hum.FallingDown:connect(function(a)
  597. if not a then return end
  598. state = "inair"
  599. end)
  600.  
  601.  
  602.  
  603. while true do
  604. runservice.RenderStepped:wait()
  605. local cam = workspace.CurrentCamera
  606. local alpha = .2
  607. sparkles.Enabled = senabled and flying and tor.Velocity.magnitude > 3
  608. pl.Enabled = lenabled
  609. if state ~= "fly" then
  610. if type(sitting) == "table" then
  611. gyro.maxTorque = Vector3.new(1,1,1)*4e6
  612. vel.maxForce = Vector3.new(1,1,1)*4e5
  613. gyro.cframe = sitting.tar.CFrame * sitting.cf
  614. vel.velocity = (gyro.cframe.p-root.Position)*10
  615. else
  616. gyro.maxTorque,vel.maxForce = Vector3.new(),Vector3.new()
  617. end
  618. end
  619. if sitting then
  620. state = "sit"
  621. end
  622. tw.MaxVelocity,rh.MaxVelocity,lh.MaxVelocity,rs.MaxVelocity,ls.MaxVelocity,nk.MaxVelocity = 0,0,0,0,0,0
  623. tw.CurrentAngle,rh.CurrentAngle,lh.CurrentAngle,rs.CurrentAngle,ls.CurrentAngle,nk.CurrentAngle = 0,0,0,0,0,0
  624.  
  625. local hasRobe = outfit == 1
  626.  
  627. if state == "idle" then
  628. hum.PlatformStand = false
  629. local breathing = math.sin(tick()*2)
  630. local tilt = .02 + breathing*.03
  631. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  632. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  633.  
  634. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  635. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt,hasRobe and 0 or -.1,hasRobe and 0 or .06),alpha)
  636. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt,hasRobe and 0 or .1,hasRobe and 0 or -.06),alpha)
  637. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt,0,.1),alpha)
  638. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt,0,-.1),alpha)
  639. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.05-.03,0,0),alpha)
  640. elseif state == "inair" then
  641. hum.PlatformStand = false
  642. local wings = math.sin(tick()*80)
  643. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.15+wings*.3,0),.6)
  644. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.15-wings*.3,0),.6)
  645. local alpha = .15
  646. local tilt = .05
  647. local wavey = math.sin(tick()*3)
  648. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  649. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+wavey*.1,0,hasRobe and 0 or .02),alpha)
  650. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt-wavey*.1,0,hasRobe and 0 or -.02),alpha)
  651. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt-wavey*.07,0,.01),alpha)
  652. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+wavey*.07,0,-.01),alpha)
  653. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+.2,0,0),alpha)
  654. elseif state == "walk" then
  655. hum.PlatformStand = false
  656. local walking = math.sin(tick()*25)
  657. local breathing = math.sin(tick()*2)
  658. local tilt = -.03-breathing*.02+walking*.01
  659. alpha = .6
  660. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.05+breathing*.01+walking*.05,0),alpha)
  661. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.05-breathing*.01+walking*.05,0),alpha)
  662.  
  663. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,-walking*.08,0),alpha)
  664. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+walking*.3,0,hasRobe and 0 or .02),alpha)
  665. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt-walking*.3,0,hasRobe and 0 or -.02),alpha)
  666. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt+.05-walking*.25,0,.01),alpha)
  667. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+.05+walking*.25,0,-.01),alpha)
  668. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.04,walking*.07,0),alpha)
  669. elseif state == "sit" then
  670. hum.Sit = false
  671. hum.PlatformStand = true
  672. local breathing = math.sin(tick()*2)
  673. local upvec = root.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))
  674. if upvec.Y > .4 then
  675. local tilt = -.55+breathing*.015
  676. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  677. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  678. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0)+Vector3.new(0,-1.7,0)*modelScale,alpha)
  679. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+1.57,0,hasRobe and 0 or .6),alpha)
  680. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt+1.57,0,hasRobe and 0 or -.6),alpha)
  681. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt+.3,0,-.1)*CFrame.Angles(hasRobe and .3 or 0,hasRobe and .2 or 0,hasRobe and -.2 or 0)+(hasRobe and 0 or 1)*Vector3.new(-.85,-.25,-.25)*modelScale,alpha)
  682. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+.3,0,.1)*CFrame.Angles(hasRobe and .3 or 0,hasRobe and -.2 or 0,hasRobe and .2 or 0)+(hasRobe and 0 or 1)*Vector3.new(.85,-.25,-.25)*modelScale,alpha)
  683. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.04-.03,0,math.sin(tick()*4)*.06),alpha)
  684. else -- wallhug
  685. local breathing = math.sin(tick()*5)
  686. local tilt = -1.55+breathing*.015
  687. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  688. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  689. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0)+Vector3.new(0,-2.5,0)*modelScale,alpha)
  690. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(.2,0,hasRobe and 0 or .5)+Vector3.new(0,hasRobe and 0 or .2,0)*modelScale,alpha)
  691. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(.2,0,hasRobe and 0 or -.5)+Vector3.new(0,hasRobe and 0 or .2,0)*modelScale,alpha)
  692. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(2.9,0,.8)+Vector3.new(-.2,.4,0)*modelScale,alpha)
  693. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(2.9,0,-.8)+Vector3.new(.2,.4,0)*modelScale,alpha)
  694. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(breathing*.04+.7,0,0),alpha)
  695. end
  696. elseif state == "fly" then
  697. hum.PlatformStand = true
  698. gyro.maxTorque = Vector3.new(1,1,1)*4e6
  699. vel.maxForce = Vector3.new(1,1,1)*4e5
  700.  
  701. local velocity = Vector3.new((kd.d and 1 or 0)+(kd.a and -1 or 0),0,(kd.s and 1 or 0)+(kd.w and -1 or 0))
  702. velocity = cam.CoordinateFrame:vectorToWorldSpace(velocity)
  703. local maxspeed = 40-(velocity.magnitude > 0 and velocity.unit.Y*20 or 0)
  704. if velocity.magnitude > 0 then
  705. flyspeed = lerp(flyspeed,maxspeed,.1)
  706. flydir = flydir:Lerp(velocity.unit,.4).unit
  707. hoverheight = nil
  708. else
  709. flyspeed = lerp(flyspeed,0,.3)
  710. flydir = (flydir*Vector3.new(1,0,1)).unit
  711. hoverheight = hoverheight or root.Position.Y
  712. end
  713. vel.velocity = flydir.unit * flyspeed
  714. if hoverheight then
  715. vel.velocity = vel.velocity + Vector3.new(0,hoverheight-root.Position.Y,0)
  716. end
  717. gyro.cframe = CFrame.new(Vector3.new(),flydir*Vector3.new(1,0,1))
  718.  
  719. rl.CanCollide,ll.CanCollide = true,true
  720.  
  721. local wings = math.sin(tick()*80)
  722. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.15+wings*.3,0),.6)
  723. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.15-wings*.3,0),.6)
  724. local alpha = .15
  725. local flytilt = (flyspeed/maxspeed)
  726. local tilt = flytilt*-1.4 + math.asin(gyro.cframe:vectorToObjectSpace(flydir).unit.Y)
  727. local wavey = math.sin(tick()*6)
  728. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  729. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(wavey*.1,hasRobe and 0 or -.08,hasRobe and 0 or .1),alpha)
  730. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-wavey*.1,hasRobe and 0 or .08,hasRobe and 0 or -.1),alpha)
  731. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-wavey*.15,-.08,.1),alpha)
  732. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(wavey*.15,.08,-.1),alpha)
  733. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt*.8,0,0),alpha)
  734. end
  735. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement