Advertisement
Guest User

434341251555553325355442542424243452542542542542542534342534

a guest
Mar 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.50 KB | None | 0 0
  1.  
  2. local plr = game:service'Players'.LocalPlayer
  3. local m = plr:GetMouse()
  4. local char = plr.Character
  5. local runservice = game:service'RunService'
  6. local modelScale = 1/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 = "SCRIPT"
  11. function weld(a,b,c,d)
  12. local w = Instance.new("Weld",a)
  13. w.Part0 = a
  14. w.Part1 = b
  15. w.C0 = c or CFrame.new()
  16. w.C1 = d or CFrame.new()
  17. return w
  18. end
  19. function lerp(a,b,c)
  20. return a+(b-a)*c
  21. end
  22. do
  23. local function QuaternionFromCFrame(cf)
  24. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  25. local trace = m00 + m11 + m22
  26. if trace > 0 then
  27. local s = math.sqrt(1 + trace)
  28. local recip = 0.5/s
  29. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  30. else
  31. local i = 0
  32. if m11 > m00 then
  33. i = 1
  34. end
  35. if m22 > (i == 0 and m00 or m11) then
  36. i = 2
  37. end
  38. if i == 0 then
  39. local s = math.sqrt(m00-m11-m22+1)
  40. local recip = 0.5/s
  41. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  42. elseif i == 1 then
  43. local s = math.sqrt(m11-m22-m00+1)
  44. local recip = 0.5/s
  45. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  46. elseif i == 2 then
  47. local s = math.sqrt(m22-m00-m11+1)
  48. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  49. end
  50. end
  51. end
  52. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  53. local xs, ys, zs = x + x, y + y, z + z
  54. local wx, wy, wz = w*xs, w*ys, w*zs
  55. local xx = x*xs
  56. local xy = x*ys
  57. local xz = x*zs
  58. local yy = y*ys
  59. local yz = y*zs
  60. local zz = z*zs
  61. 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))
  62. end
  63. local function QuaternionSlerp(a, b, t)
  64. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  65. local startInterp, finishInterp;
  66. if cosTheta >= 0.0001 then
  67. if (1 - cosTheta) > 0.0001 then
  68. local theta = math.acos(cosTheta)
  69. local invSinTheta = 1/math.sin(theta)
  70. startInterp = math.sin((1-t)*theta)*invSinTheta
  71. finishInterp = math.sin(t*theta)*invSinTheta
  72. else
  73. startInterp = 1-t
  74. finishInterp = t
  75. end
  76. else
  77. if (1+cosTheta) > 0.0001 then
  78. local theta = math.acos(-cosTheta)
  79. local invSinTheta = 1/math.sin(theta)
  80. startInterp = math.sin((t-1)*theta)*invSinTheta
  81. finishInterp = math.sin(t*theta)*invSinTheta
  82. else
  83. startInterp = t-1
  84. finishInterp = t
  85. end
  86. end
  87. 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
  88. end
  89. function clerp(a,b,t)
  90. local qa = {QuaternionFromCFrame(a)}
  91. local qb = {QuaternionFromCFrame(b)}
  92. local ax, ay, az = a.x, a.y, a.z
  93. local bx, by, bz = b.x, b.y, b.z
  94. local _t = 1-t
  95. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  96. end
  97. end
  98.  
  99. local root = char.HumanoidRootPart
  100. local tw = root.RootJoint
  101. local tor = char.Torso
  102. local hd = char.Head
  103. local hum = char.Humanoid
  104. hum.MaxHealth = math.huge
  105. hum.Health = math.huge
  106. hum.WalkSpeed = 25
  107. hum.HipHeight = .05
  108. local rl,ll = char["Right Leg"],char["Left Leg"]
  109. local ra,la = char["Right Arm"],char["Left Arm"]
  110. char.Head.CustomPhysicalProperties = PhysicalProperties.new(100,100,100,100,100)
  111.  
  112.  
  113. local c0 = {
  114. rs = CFrame.new(1,.5,0),
  115. ls = CFrame.new(-1,.5,0),
  116. rh = CFrame.new(.5,-1,0),
  117. lh = CFrame.new(-.5,-1,0),
  118. nk = CFrame.new(0,1,0),
  119. tw = CFrame.new(0,0,0)*CFrame.Angles(0,0,0),
  120. }
  121. local c1 = {
  122. rs = CFrame.new(-.5,.5,0),
  123. ls = CFrame.new(.5,.5,0),
  124. rh = CFrame.new(0,1,0),
  125. lh = CFrame.new(0,1,0),
  126. nk = CFrame.new(0,-.5,0),
  127. tw = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  128. }
  129. local rs = tor["Right Shoulder"]
  130. local ls = tor["Left Shoulder"]
  131. local rh = tor["Right Hip"]
  132. local lh = tor["Left Hip"]
  133. local nk = tor["Neck"]
  134. for i,v in pairs(tor:GetChildren()) do
  135. if v:IsA("Motor6D") then
  136. v.DesiredAngle = 0
  137. v.MaxVelocity = 0
  138. v.CurrentAngle = 0
  139. end
  140. end
  141.  
  142.  
  143. pcall(function() tor.roblox:Destroy() end)
  144. pcall(function() char.Faerie:Destroy() end)
  145. local model = Instance.new("Model",char)
  146. model.Name = "SCRIPT"
  147. local BasePart = Instance.new("Part")
  148. BasePart.CanCollide = false
  149. BasePart.Anchored = false
  150. BasePart.FormFactor = "Custom"
  151. BasePart.Locked = true
  152. BasePart.Size = Vector3.new()
  153. BasePart.TopSurface,BasePart.BottomSurface,BasePart.LeftSurface,BasePart.RightSurface,BasePart.FrontSurface,BasePart.BackSurface = 10,10,10,10,10,10
  154. BasePart:BreakJoints()
  155. function NP(par)
  156. local p = BasePart:Clone()
  157. p.Parent = par or model
  158. return p
  159. end
  160. local w1 = NP()
  161. w1.Transparency = .1
  162. local w1m = Instance.new("SpecialMesh",w1)
  163. w1m.MeshId = ""
  164. w1m.TextureId = ""
  165. w1m.Scale = Vector3.new(0, 0, 0)
  166. local w1 = weld(tor,w1,CFrame.new(-.1,0.55,1.6))
  167. local w2 = NP()
  168. w2.Transparency = .1
  169. local w2m = Instance.new("SpecialMesh",w2)
  170. w2m.MeshId = ""
  171. w2m.TextureId = ""
  172. w2m.Scale = Vector3.new(0, 0, 0)
  173. local w2 = weld(tor,w2,CFrame.new(.1,0.55,1.6))
  174. local h = NP()
  175. local hm = Instance.new("SpecialMesh",h)
  176. hm.MeshId = "http://www.roblox.com/asset/?id=97714538"
  177. hm.TextureId = "http://www.roblox.com/asset/?id=97714619"
  178. hm.Scale = Vector3.new(2, 2, 2)
  179. weld(tor,h,CFrame.new(.1,-.1,.7))
  180. for i,v in pairs(char:GetChildren()) do
  181. if v:IsA("BasePart") then
  182. v.Material = "SmoothPlastic"
  183. v.TopSurface,v.BottomSurface,v.FrontSurface,v.BackSurface,v.LeftSurface,v.RightSurface = 10,10,10,10,10,10
  184. end
  185. end
  186.  
  187. do
  188. if modelScale ~= 1 then
  189. for i,v in pairs(c0) do
  190. c0[i] = (v-v.p) + v.p*modelScale
  191. end
  192. for i,v in pairs(c1) do
  193. c1[i] = (v-v.p) + v.p*modelScale
  194. end
  195. local Joints = {}
  196. local gtJoints,gtParts;
  197. local function gtCFrame(cf)
  198. return (cf-cf.p) + cf.p * modelScale
  199. end
  200. function gtJoints(p)
  201. for i,v in pairs(p:GetChildren()) do
  202. if v:IsA("JointInstance") then
  203. table.insert(Joints,{v,v.Part0,v.Part1})
  204. v.Part0 = nil
  205. v.Part1 = nil
  206. v.C0 = (v.C0-(v.C0.p)) + (v.C0.p * modelScale)
  207. v.C1 = (v.C1-(v.C1.p)) + (v.C1.p * modelScale)
  208. end
  209. gtJoints(v)
  210. end
  211. end
  212. function gtParts(p)
  213. for i,v in pairs(p:GetChildren()) do
  214. if v:IsA("BasePart") then
  215. pcall(function() v.FormFactor = "Custom" end)
  216. local oldz = v.Size
  217. local cf = tor.CFrame:toObjectSpace(v.CFrame)
  218. v.Size = v.Size * modelScale
  219. v.CFrame = tor.CFrame * gtCFrame(cf)
  220. local mesh = nil
  221. for i,t in pairs(v:GetChildren()) do
  222. if t:IsA("DataModelMesh") then
  223. mesh = t
  224. end
  225. end
  226. if mesh == nil and v:IsA("Part") and v.Shape == Enum.PartType.Ball then
  227. mesh = Instance.new("SpecialMesh",v)
  228. mesh.MeshType = Enum.MeshType.Sphere
  229. end
  230. if mesh == nil and ((v:IsA("Part") and v.Shape == Enum.PartType.Block) or v:IsA("Seat") or v:IsA("VehicleSeat")) then
  231. mesh = Instance.new("BlockMesh",v)
  232. end
  233. if mesh ~= nil then
  234. if mesh:IsA("SpecialMesh") and mesh.MeshType == Enum.MeshType.FileMesh then
  235. mesh.Scale = mesh.Scale * modelScale
  236. else
  237. mesh.Scale = mesh.Scale*(oldz*modelScale)/v.Size
  238. end
  239. end
  240. end
  241. gtParts(v)
  242. end
  243.  
  244. end
  245. gtJoints(char)
  246. gtParts(char)
  247. for i,v in pairs(Joints) do
  248. v[1].Part0 = v[2]
  249. v[1].Part1 = v[3]
  250. end
  251. end
  252.  
  253. rs.C0,rs.C1 = c0.rs,c1.rs
  254. ls.C0,ls.C1 = c0.ls,c1.ls
  255. rh.C0,rh.C1 = c0.rh,c1.rh
  256. lh.C0,lh.C1 = c0.lh,c1.lh
  257. nk.C0,nk.C1 = c0.nk,c1.nk
  258. tw.C0,tw.C1 = c0.tw,c1.tw
  259. local w10,w20 = w1.C0,w2.C0
  260.  
  261.  
  262.  
  263.  
  264. local gyro = root:FindFirstChild("RootGyro") or Instance.new("BodyGyro",root)
  265. gyro.maxTorque = Vector3.new()
  266. gyro.Name = "RootGyro"
  267. local vel = root:FindFirstChild("RootVel") or Instance.new("BodyVelocity",root)
  268. vel.maxForce = Vector3.new()
  269. vel.Name = "RootVel"
  270. vel.P = 4000
  271. local flying = false
  272. local state = "idle"
  273. local kd = {}
  274. local humspd = 0
  275. local flyspeed = 0
  276. local flystop = 0
  277. local sitting = false
  278. local holding = false
  279. m.KeyDown:connect(function(k)
  280. local now = tick()
  281. kd[k] = now
  282. if k == " " and not flying then
  283. pcall(function() sitting:Destroy() end)
  284. sitting = nil
  285. state = "fly"
  286. flying = true
  287. flydir = (root.CFrame.lookVector*Vector3.new(1,0,1)).unit
  288. elseif k == " " and state == "fly" then
  289. flying = false
  290. state = "idle"
  291. flystop = tick()
  292. elseif k == "c" and m.Target and (root.Position-m.Hit.p).magnitude < 20*modelScale then
  293. local tar = m.Target
  294. local cf = tar.CFrame:toObjectSpace(m.Hit)
  295. local siz = tar.Size/2
  296. local cfr
  297. local rx,ry,rz = 0,0,0
  298. local lv = tar.CFrame:vectorToObjectSpace(root.CFrame.lookVector)
  299. if math.abs(cf.Y-siz.Y) < .03 then
  300. cfr = CFrame.new(cf.p + Vector3.new(0,3*modelScale,0)) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  301. elseif math.abs(-cf.Y-siz.Y) < .03 then
  302. cfr = CFrame.new(cf.p - Vector3.new(0,3*modelScale,0)) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),math.pi)
  303. elseif math.abs(cf.X-siz.X) < .03 then
  304. 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)
  305. elseif math.abs(-cf.X-siz.X) < .03 then
  306. 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)
  307. elseif math.abs(cf.Z-siz.Z) < .03 then
  308. 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)
  309. elseif math.abs(-cf.Z-siz.Z) < .03 then
  310. 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)
  311. end
  312. if cfr then
  313. pcall(function() sitting:Destroy() end)
  314. flying = false
  315. state = "sit"
  316. if m.Target.Anchored then
  317. sitting = {tar = tar, cf = cfr}
  318. else
  319. sitting = weld(tar,root,cfr)
  320. end
  321. end
  322. end
  323. end)
  324. m.KeyUp:connect(function(k)
  325. kd[k] = nil
  326. end)
  327. hum.Running:connect(function(spd)
  328. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  329. humspd = spd
  330. state = flying and "fly" or (spd < 1 and "idle" or "walk")
  331. end)
  332. hum.Climbing:connect(function(spd)
  333. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  334. humspd = spd
  335. state = flying and "fly" or (spd < 1 and "idle" or "walk")
  336. end)
  337. hum.Seated:connect(function(a)
  338. state = a and "sit" or humspd > 0 and "idle" or "walk"
  339. end)
  340. hum.Changed:connect(function()
  341. if hum.Jump then
  342. hum.Jump = false
  343. end
  344. end)
  345. hum.FreeFalling:connect(function()
  346. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  347. state = math.abs(tor.Velocity.Y) > 1 and "inair" or state
  348. end)
  349. hum.FallingDown:connect(function(a)
  350. if not a then return end
  351. state = "inair"
  352. end)
  353.  
  354. ---remove block mesh---
  355. for i, v in ipairs(char:getChildren()) do
  356. if v:IsA("BasePart") then
  357. print("Finding mesh to remove")
  358. print("Finding mesh to remove 2")
  359. if v:FindFirstChild("Mesh") then
  360. print("Finding mesh to remove 3")
  361. if v.Mesh.ClassName == "BlockMesh" then
  362. v.Mesh:Destroy()
  363. print("removing mesh that hides clothing.")
  364. end
  365. end
  366. end
  367. end
  368.  
  369.  
  370. while true do
  371. runservice.RenderStepped:wait()
  372. local cam = workspace.CurrentCamera
  373. local alpha = .2
  374. sparkles.Enabled = senabled and flying and tor.Velocity.magnitude > 3
  375. pl.Enabled = lenabled
  376. if state ~= "fly" then
  377. if type(sitting) == "table" then
  378. gyro.maxTorque = Vector3.new(1,1,1)*4e6
  379. vel.maxForce = Vector3.new(1,1,1)*4e5
  380. gyro.cframe = sitting.tar.CFrame * sitting.cf
  381. vel.velocity = (gyro.cframe.p-root.Position)*10
  382. else
  383. gyro.maxTorque,vel.maxForce = Vector3.new(),Vector3.new()
  384. end
  385. end
  386. if sitting then
  387. state = "sit"
  388. end
  389. tw.MaxVelocity,rh.MaxVelocity,lh.MaxVelocity,rs.MaxVelocity,ls.MaxVelocity,nk.MaxVelocity = 0,0,0,0,0,0
  390. tw.CurrentAngle,rh.CurrentAngle,lh.CurrentAngle,rs.CurrentAngle,ls.CurrentAngle,nk.CurrentAngle = 0,0,0,0,0,0
  391. local hasRobe = outfit == 1
  392. if state == "idle" then
  393. hum.PlatformStand = false
  394. local breathing = math.sin(tick()*2)
  395. local tilt = .02 + breathing*.03
  396. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  397. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  398. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  399. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt,hasRobe and 0 or -.1,hasRobe and 0 or .06),alpha)
  400. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt,hasRobe and 0 or .1,hasRobe and 0 or -.06),alpha)
  401. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt,0,.1),alpha)
  402. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt,0,-.1),alpha)
  403. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.05-.03,0,0),alpha)
  404. elseif state == "inair" then
  405. hum.PlatformStand = false
  406. local wings = math.sin(tick()*80)
  407. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.15+wings*.3,0),.6)
  408. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.15-wings*.3,0),.6)
  409. local alpha = .15
  410. local tilt = .05
  411. local wavey = math.sin(tick()*3)
  412. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  413. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+wavey*.1,0,hasRobe and 0 or .02),alpha)
  414. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt-wavey*.1,0,hasRobe and 0 or -.02),alpha)
  415. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt-wavey*.07,0,.01),alpha)
  416. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+wavey*.07,0,-.01),alpha)
  417. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+.2,0,0),alpha)
  418. elseif state == "walk" then
  419. hum.PlatformStand = false
  420. local walking = math.sin(tick()*25)
  421. local breathing = math.sin(tick()*2)
  422. local tilt = -.03-breathing*.02+walking*.01
  423. alpha = .6
  424. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.05+breathing*.01+walking*.05,0),alpha)
  425. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.05-breathing*.01+walking*.05,0),alpha)
  426. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,-walking*.08,0),alpha)
  427. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+walking*.3,0,hasRobe and 0 or .02),alpha)
  428. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt-walking*.3,0,hasRobe and 0 or -.02),alpha)
  429. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt+.05-walking*.25,0,.01),alpha)
  430. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+.05+walking*.25,0,-.01),alpha)
  431. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.04,walking*.07,0),alpha)
  432. elseif state == "sit" then
  433. hum.Sit = false
  434. hum.PlatformStand = true
  435. local breathing = math.sin(tick()*2)
  436. local upvec = root.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))
  437. if upvec.Y > .4 then
  438. local tilt = -.55+breathing*.015
  439. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  440. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  441. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0)+Vector3.new(0,-1.7,0)*modelScale,alpha)
  442. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+1.57,0,hasRobe and 0 or .6),alpha)
  443. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt+1.57,0,hasRobe and 0 or -.6),alpha)
  444. 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)
  445. 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)
  446. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.04-.03,0,math.sin(tick()*4)*.06),alpha)
  447. else -- wallhug
  448. local breathing = math.sin(tick()*5)
  449. local tilt = -1.55+breathing*.015
  450. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  451. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  452. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0)+Vector3.new(0,-2.5,0)*modelScale,alpha)
  453. 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)
  454. 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)
  455. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(2.9,0,.8)+Vector3.new(-.2,.4,0)*modelScale,alpha)
  456. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(2.9,0,-.8)+Vector3.new(.2,.4,0)*modelScale,alpha)
  457. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(breathing*.04+.7,0,0),alpha)
  458. end
  459. elseif state == "fly" then
  460. hum.PlatformStand = true
  461. gyro.maxTorque = Vector3.new(1,1,1)*4e6
  462. vel.maxForce = Vector3.new(1,1,1)*4e5
  463. 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))
  464. velocity = cam.CoordinateFrame:vectorToWorldSpace(velocity)
  465. local maxspeed = 40-(velocity.magnitude > 0 and velocity.unit.Y*20 or 0)
  466. if velocity.magnitude > 0 then
  467. flyspeed = lerp(flyspeed,maxspeed,.1)
  468. flydir = flydir:Lerp(velocity.unit,.4).unit
  469. hoverheight = nil
  470. else
  471. flyspeed = lerp(flyspeed,0,.3)
  472. flydir = (flydir*Vector3.new(1,0,1)).unit
  473. hoverheight = hoverheight or root.Position.Y
  474. end
  475. vel.velocity = flydir.unit * flyspeed
  476. if hoverheight then
  477. vel.velocity = vel.velocity + Vector3.new(0,hoverheight-root.Position.Y,0)
  478. end
  479. gyro.cframe = CFrame.new(Vector3.new(),flydir*Vector3.new(1,0,1))
  480. rl.CanCollide,ll.CanCollide = true,true
  481. local wings = math.sin(tick()*80)
  482. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.15+wings*.3,0),.6)
  483. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.15-wings*.3,0),.6)
  484. local alpha = .15
  485. local flytilt = (flyspeed/maxspeed)
  486. local tilt = flytilt*-1.4 + math.asin(gyro.cframe:vectorToObjectSpace(flydir).unit.Y)
  487. local wavey = math.sin(tick()*6)
  488. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  489. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(wavey*.1,hasRobe and 0 or -.08,hasRobe and 0 or .1),alpha)
  490. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-wavey*.1,hasRobe and 0 or .08,hasRobe and 0 or -.1),alpha)
  491. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-wavey*.15,-.08,.1),alpha)
  492. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(wavey*.15,.08,-.1),alpha)
  493. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt*.8,0,0),alpha)
  494. end
  495. end
  496. end
  497. --for i, v in ipairs(char:getChildren()) do
  498. -- if v:IsA("BasePart") then
  499. -- print("Finding mesh to remove")
  500. -- if not v.Name == "Head" then
  501. -- if v.Mesh.ClassName == "BlockMesh" then
  502. -- v.Mesh:Destroy()
  503. -- print("removing mesh that hides clothing.")
  504. -- end
  505. -- end
  506. -- end
  507. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement