Advertisement
5325325325

Untitled

Nov 17th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.07 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by stanjicmario")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  6.  
  7. -- Press X where you wanna sit
  8.  
  9.  
  10. local plr = owner
  11.  
  12. local char = plr.Character
  13.  
  14. local hed = plr.Character.Head
  15.  
  16. local runservice = game:service'RunService'
  17.  
  18. local modelScale = 1/5
  19.  
  20. plr.Chatted:connect(function(msg)
  21. game:service'Chat':Chat(hed, msg, 1)
  22. if msg == "die/" then
  23. char:breakJoints()
  24. end
  25.  
  26. end)
  27.  
  28.  
  29. pcall(function() local a = script.Parent.FaerieScript if a ~= script then a:Destroy() end end)
  30.  
  31. pcall(function() local a = char.Animate if a ~= script then a.Disabled = true a:Destroy() end end)
  32.  
  33. script.Name = "FaerieScript"
  34.  
  35.  
  36. function weld(a,b,c,d)
  37.  
  38. local w = Instance.new("Weld",a)
  39.  
  40. w.Part0 = a
  41.  
  42. w.Part1 = b
  43.  
  44. w.C0 = c or CFrame.new()
  45.  
  46. w.C1 = d or CFrame.new()
  47.  
  48. return w
  49.  
  50. end
  51.  
  52.  
  53. function lerp(a,b,c)
  54.  
  55. return a+(b-a)*c
  56.  
  57. end
  58.  
  59.  
  60. do -- Ignore my clerp stuff stolen from stravvy
  61.  
  62. local function QuaternionFromCFrame(cf)
  63.  
  64. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  65.  
  66. local trace = m00 + m11 + m22
  67.  
  68. if trace > 0 then
  69.  
  70. local s = math.sqrt(1 + trace)
  71.  
  72. local recip = 0.5/s
  73.  
  74. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  75.  
  76. else
  77.  
  78. local i = 0
  79.  
  80. if m11 > m00 then
  81.  
  82. i = 1
  83.  
  84. end
  85.  
  86. if m22 > (i == 0 and m00 or m11) then
  87.  
  88. i = 2
  89.  
  90. end
  91.  
  92. if i == 0 then
  93.  
  94. local s = math.sqrt(m00-m11-m22+1)
  95.  
  96. local recip = 0.5/s
  97.  
  98. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  99.  
  100. elseif i == 1 then
  101.  
  102. local s = math.sqrt(m11-m22-m00+1)
  103.  
  104. local recip = 0.5/s
  105.  
  106. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  107.  
  108. elseif i == 2 then
  109.  
  110. local s = math.sqrt(m22-m00-m11+1)
  111.  
  112. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  113.  
  114. end
  115.  
  116. end
  117.  
  118. end
  119.  
  120. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  121.  
  122. local xs, ys, zs = x + x, y + y, z + z
  123.  
  124. local wx, wy, wz = w*xs, w*ys, w*zs
  125.  
  126. local xx = x*xs
  127.  
  128. local xy = x*ys
  129.  
  130. local xz = x*zs
  131.  
  132. local yy = y*ys
  133.  
  134. local yz = y*zs
  135.  
  136. local zz = z*zs
  137.  
  138. 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))
  139.  
  140. end
  141.  
  142. local function QuaternionSlerp(a, b, t)
  143.  
  144. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  145.  
  146. local startInterp, finishInterp;
  147.  
  148. if cosTheta >= 0.0001 then
  149.  
  150. if (1 - cosTheta) > 0.0001 then
  151.  
  152. local theta = math.acos(cosTheta)
  153.  
  154. local invSinTheta = 1/math.sin(theta)
  155.  
  156. startInterp = math.sin((1-t)*theta)*invSinTheta
  157.  
  158. finishInterp = math.sin(t*theta)*invSinTheta
  159.  
  160. else
  161.  
  162. startInterp = 1-t
  163.  
  164. finishInterp = t
  165.  
  166. end
  167.  
  168. else
  169.  
  170. if (1+cosTheta) > 0.0001 then
  171.  
  172. local theta = math.acos(-cosTheta)
  173.  
  174. local invSinTheta = 1/math.sin(theta)
  175.  
  176. startInterp = math.sin((t-1)*theta)*invSinTheta
  177.  
  178. finishInterp = math.sin(t*theta)*invSinTheta
  179.  
  180. else
  181.  
  182. startInterp = t-1
  183.  
  184. finishInterp = t
  185.  
  186. end
  187.  
  188. end
  189.  
  190. 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
  191.  
  192. end
  193.  
  194. function clerp(a,b,t)
  195.  
  196. local qa = {QuaternionFromCFrame(a)}
  197.  
  198. local qb = {QuaternionFromCFrame(b)}
  199.  
  200. local ax, ay, az = a.x, a.y, a.z
  201.  
  202. local bx, by, bz = b.x, b.y, b.z
  203.  
  204. local _t = 1-t
  205.  
  206. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  207.  
  208. end
  209.  
  210. end
  211.  
  212.  
  213. for i,v in pairs(char:GetChildren()) do
  214.  
  215. if v:IsA("Hat") or v:IsA("BodyColors") or v:IsA("Clothing") or v:IsA("ShirtGraphic") then
  216.  
  217. v:Destroy()
  218.  
  219. end
  220.  
  221. end
  222.  
  223. Instance.new("Hat",char)
  224.  
  225. local root = char.HumanoidRootPart
  226.  
  227. local tw = root.RootJoint
  228.  
  229. local tor = char.Torso
  230.  
  231. local hd = char.Head
  232.  
  233. local hum = char.Humanoid
  234.  
  235. hum.Health = 40
  236.  
  237. hum.MaxHealth = 40
  238.  
  239. hum.WalkSpeed = 12
  240.  
  241. local rl,ll = char["Right Leg"],char["Left Leg"]
  242.  
  243. local ra,la = char["Right Arm"],char["Left Arm"]
  244.  
  245.  
  246. local c0 = {
  247.  
  248. rs = CFrame.new(1,.5,0),
  249.  
  250. ls = CFrame.new(-1,.5,0),
  251.  
  252. rh = CFrame.new(.5,-1,0),
  253.  
  254. lh = CFrame.new(-.5,-1,0),
  255.  
  256. nk = CFrame.new(0,1,0),
  257.  
  258. tw = CFrame.new(0,0,0)*CFrame.Angles(0,0,0),
  259.  
  260. }
  261.  
  262. local c1 = {
  263.  
  264. rs = CFrame.new(-.5,.5,0),
  265.  
  266. ls = CFrame.new(.5,.5,0),
  267.  
  268. rh = CFrame.new(0,1,0),
  269.  
  270. lh = CFrame.new(0,1,0),
  271.  
  272. nk = CFrame.new(0,-.5,0),
  273.  
  274. tw = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  275.  
  276. }
  277.  
  278.  
  279. local rs = tor["Right Shoulder"]
  280.  
  281. local ls = tor["Left Shoulder"]
  282.  
  283. local rh = tor["Right Hip"]
  284.  
  285. local lh = tor["Left Hip"]
  286.  
  287. local nk = tor["Neck"]
  288.  
  289. for i,v in pairs(tor:GetChildren()) do
  290.  
  291. if v:IsA("Motor6D") then
  292.  
  293. v.DesiredAngle = 0
  294.  
  295. v.MaxVelocity = 0
  296.  
  297. v.CurrentAngle = 0
  298.  
  299. end
  300.  
  301. end
  302.  
  303.  
  304.  
  305.  
  306.  
  307. pcall(function() tor.roblox:Destroy() end)
  308.  
  309.  
  310. pcall(function() char.Faerie:Destroy() end)
  311.  
  312. local model = Instance.new("Model",char)
  313.  
  314. model.Name = "Faerie"
  315.  
  316.  
  317. local BasePart = Instance.new("Part")
  318.  
  319. BasePart.CanCollide = false
  320.  
  321. BasePart.Anchored = false
  322.  
  323. BasePart.FormFactor = "Custom"
  324.  
  325. BasePart.Locked = true
  326.  
  327. BasePart.Size = Vector3.new()
  328.  
  329. BasePart.TopSurface,BasePart.BottomSurface,BasePart.LeftSurface,BasePart.RightSurface,BasePart.FrontSurface,BasePart.BackSurface = 10,10,10,10,10,10
  330.  
  331. BasePart:BreakJoints()
  332.  
  333.  
  334. function NP(par)
  335.  
  336. local p = BasePart:Clone()
  337.  
  338. p.Parent = par or model
  339.  
  340. return p
  341.  
  342. end
  343.  
  344.  
  345. local w1 = NP()
  346.  
  347. w1.Transparency = .1
  348.  
  349. local w1m = Instance.new("SpecialMesh",w1)
  350.  
  351. w1m.MeshId = "rbxassetid://19367766"
  352.  
  353. w1m.TextureId = "rbxassetid://9854798"
  354.  
  355. w1m.Scale = Vector3.new(1.05, 1.05, 1.05)
  356.  
  357. local w1 = weld(tor,w1,CFrame.new(-.1,0.55,1.6))
  358.  
  359.  
  360. local w2 = NP()
  361.  
  362. w2.Transparency = .1
  363.  
  364. local w2m = Instance.new("SpecialMesh",w2)
  365.  
  366. w2m.MeshId = "rbxassetid://19367766"
  367.  
  368. w2m.TextureId = "rbxassetid://9854798"
  369.  
  370. w2m.Scale = Vector3.new(1.05, 1.05, 1.05)
  371.  
  372. local w2 = weld(tor,w2,CFrame.new(.1,0.55,1.6))
  373.  
  374.  
  375. local h = NP()
  376.  
  377. local hm = Instance.new("SpecialMesh",h)
  378.  
  379. hm.MeshId = "rbxassetid://154820214"
  380.  
  381. hm.TextureId = "rbxassetid://91740209"
  382.  
  383. hm.Scale = Vector3.new(1, 1, 1)
  384.  
  385. weld(hd,h,CFrame.new(0,0.2,0))
  386.  
  387.  
  388. for i,v in pairs(char:GetChildren()) do
  389.  
  390. if v:IsA("BasePart") then
  391.  
  392. v.Material = "SmoothPlastic"
  393.  
  394. v.TopSurface,v.BottomSurface,v.FrontSurface,v.BackSurface,v.LeftSurface,v.RightSurface = 10,10,10,10,10,10
  395.  
  396. end
  397.  
  398. end
  399.  
  400.  
  401. do
  402.  
  403. if modelScale ~= 1 then
  404.  
  405. for i,v in pairs(c0) do
  406.  
  407. c0[i] = (v-v.p) + v.p*modelScale
  408.  
  409. end
  410.  
  411. for i,v in pairs(c1) do
  412.  
  413. c1[i] = (v-v.p) + v.p*modelScale
  414.  
  415. end
  416.  
  417. local Joints = {}
  418.  
  419. local gtJoints,gtParts;
  420.  
  421.  
  422. local function gtCFrame(cf)
  423.  
  424. return (cf-cf.p) + cf.p * modelScale
  425.  
  426. end
  427.  
  428.  
  429. function gtJoints(p)
  430.  
  431. for i,v in pairs(p:GetChildren()) do
  432.  
  433. if v:IsA("JointInstance") then
  434.  
  435. table.insert(Joints,{v,v.Part0,v.Part1})
  436.  
  437. v.Part0 = nil
  438.  
  439. v.Part1 = nil
  440.  
  441. v.C0 = (v.C0-(v.C0.p)) + (v.C0.p * modelScale)
  442.  
  443. v.C1 = (v.C1-(v.C1.p)) + (v.C1.p * modelScale)
  444.  
  445. end
  446.  
  447. gtJoints(v)
  448.  
  449. end
  450.  
  451. end
  452.  
  453.  
  454. function gtParts(p)
  455.  
  456. for i,v in pairs(p:GetChildren()) do
  457.  
  458. if v:IsA("BasePart") then
  459.  
  460. pcall(function() v.FormFactor = "Custom" end)
  461.  
  462. local oldz = v.Size
  463.  
  464. local cf = tor.CFrame:toObjectSpace(v.CFrame)
  465.  
  466. v.Size = v.Size * modelScale
  467.  
  468. v.CFrame = tor.CFrame * gtCFrame(cf)
  469.  
  470. local mesh = nil
  471.  
  472. for i,t in pairs(v:GetChildren()) do
  473.  
  474. if t:IsA("DataModelMesh") then
  475.  
  476. mesh = t
  477.  
  478. end
  479.  
  480. end
  481.  
  482. if mesh == nil and v:IsA("Part") and v.Shape == Enum.PartType.Ball then
  483.  
  484. mesh = Instance.new("SpecialMesh",v)
  485.  
  486. mesh.MeshType = Enum.MeshType.Sphere
  487.  
  488. end
  489.  
  490. if mesh == nil and ((v:IsA("Part") and v.Shape == Enum.PartType.Block) or v:IsA("Seat") or v:IsA("VehicleSeat")) then
  491.  
  492. mesh = Instance.new("BlockMesh",v)
  493.  
  494. end
  495.  
  496. if mesh ~= nil then
  497.  
  498. if mesh:IsA("SpecialMesh") and mesh.MeshType == Enum.MeshType.FileMesh then
  499.  
  500. mesh.Scale = mesh.Scale * modelScale
  501.  
  502. else
  503.  
  504. mesh.Scale = mesh.Scale*(oldz*modelScale)/v.Size
  505.  
  506. end
  507.  
  508. end
  509.  
  510. end
  511.  
  512. gtParts(v)
  513.  
  514. end
  515.  
  516. end
  517.  
  518. gtJoints(char)
  519.  
  520. gtParts(char)
  521.  
  522. for i,v in pairs(Joints) do
  523.  
  524. v[1].Part0 = v[2]
  525.  
  526. v[1].Part1 = v[3]
  527.  
  528. end
  529.  
  530. end
  531.  
  532. end
  533.  
  534. rs.C0,rs.C1 = c0.rs,c1.rs
  535.  
  536. ls.C0,ls.C1 = c0.ls,c1.ls
  537.  
  538. rh.C0,rh.C1 = c0.rh,c1.rh
  539.  
  540. lh.C0,lh.C1 = c0.lh,c1.lh
  541.  
  542. nk.C0,nk.C1 = c0.nk,c1.nk
  543.  
  544. tw.C0,tw.C1 = c0.tw,c1.tw
  545.  
  546.  
  547. local w10,w20 = w1.C0,w2.C0
  548.  
  549.  
  550. local pl = tor:FindFirstChild("FairyLight") or Instance.new("PointLight",tor)
  551.  
  552. pl.Name = "FairyLight"
  553.  
  554. pl.Shadows = false
  555.  
  556. pl.Range = 8
  557.  
  558. pl.Brightness = 10
  559.  
  560.  
  561. local sparkles = tor:FindFirstChild("FairySparkles") or Instance.new("Sparkles",tor)
  562.  
  563. sparkles.Name = "FairySparkles"
  564.  
  565.  
  566.  
  567. local outfit = 0
  568.  
  569. local outfitparts = {ra,la,rl,ll,tor}
  570.  
  571. local outfits = {
  572.  
  573. {{106705109},{106705077},{106703301},{106703213},{106705037}}
  574.  
  575. }
  576.  
  577.  
  578.  
  579. local mycolor = ll.BrickColor.Color
  580.  
  581. local mycolor2 = mycolor
  582.  
  583.  
  584. function setOutfit()
  585.  
  586. local of = outfits[outfit]
  587.  
  588. if of then
  589.  
  590. for i,v in pairs(outfitparts) do
  591.  
  592. local mesh = v:FindFirstChild("outfitMesh")
  593.  
  594. local meshdata = outfits[outfit][i]
  595.  
  596. if not mesh then
  597.  
  598. mesh = Instance.new("SpecialMesh",v)
  599.  
  600. mesh.Name = "outfitMesh"
  601.  
  602. mesh.TextureId = "rbxassetid://9854798"
  603.  
  604. end
  605.  
  606. mesh.Scale =(meshdata[2] or Vector3.new(1,1,1)) * modelScale
  607.  
  608. mesh.MeshId = "rbxassetid://"..meshdata[1]
  609.  
  610. mesh.VertexColor = Vector3.new(mycolor2.r,mycolor2.g,mycolor2.b)
  611.  
  612. end
  613.  
  614. else
  615.  
  616. for i,v in pairs(outfitparts) do
  617.  
  618. pcall(function() v.outfitMesh:Destroy() end)
  619.  
  620. end
  621.  
  622. end
  623.  
  624. end
  625.  
  626. setOutfit()
  627.  
  628.  
  629. local senabled = true
  630.  
  631. local lenabled = true
  632.  
  633. function changeColor()
  634.  
  635. for i,v in pairs(char:GetChildren()) do
  636.  
  637. if v:IsA("BasePart") then
  638.  
  639. v.BrickColor = BrickColor.new(mycolor)
  640.  
  641. end
  642.  
  643. end
  644.  
  645. local mc1 = Vector3.new(mycolor.r,mycolor.g,mycolor.b)
  646.  
  647. local mc2 = Vector3.new(mycolor2.r,mycolor2.g,mycolor2.b)
  648.  
  649. w1m.VertexColor,w2m.VertexColor,hm.VertexColor = mc1,mc1,mc2
  650.  
  651. for i,v in pairs(outfitparts) do
  652.  
  653. local mesh = v:FindFirstChild("outfitMesh")
  654.  
  655. if mesh then
  656.  
  657. mesh.VertexColor = mc2
  658.  
  659. end
  660.  
  661. end
  662.  
  663. pl.Color = mycolor
  664.  
  665. sparkles.SparkleColor = mycolor
  666.  
  667. end
  668.  
  669. changeColor()
  670.  
  671.  
  672. do
  673.  
  674. pcall(function() plr.PlayerGui.fairyColoring:Destroy() end)
  675.  
  676. local scr = Instance.new("ScreenGui",plr.PlayerGui)
  677.  
  678. scr.Name = "fairyColoring"
  679.  
  680. local fr = Instance.new("Frame",scr)
  681.  
  682. fr.Size = UDim2.new(0,-150,0,-65)
  683.  
  684. fr.BackgroundColor3 = Color3.new(1,1,1)
  685.  
  686. fr.BorderColor3 = Color3.new(.05,.05,.05)
  687.  
  688. fr.BackgroundTransparency = .8
  689.  
  690. fr.Position = UDim2.new(1,0,1,scr.Parent:FindFirstChild("PandaHelpNotify") and -20 or 0)
  691.  
  692. fr.ZIndex = 9
  693.  
  694. local am = 75
  695.  
  696. local rval,gval,bval = mycolor.r,mycolor.g,mycolor.b
  697.  
  698. local r = Instance.new("TextButton",fr)
  699.  
  700. r.BackgroundTransparency = 1
  701.  
  702. r.Size = UDim2.new(0,75,0,15)
  703.  
  704. r.Position = UDim2.new(0,5,0,5)
  705.  
  706. r.TextColor3 = Color3.new(1,1,1)
  707.  
  708. r.TextStrokeTransparency = .4
  709.  
  710. for i=1,am do
  711.  
  712. local t = Instance.new("ImageLabel",r)
  713.  
  714. t.BorderSizePixel = 0
  715.  
  716. t.Size = UDim2.new(1/am,0,1,0)
  717.  
  718. t.Position = UDim2.new((i-1)/am,0,0,0)
  719.  
  720. t.Name = i
  721.  
  722. t.ZIndex = 10
  723.  
  724. end
  725.  
  726. local rb = Instance.new("ImageLabel",r)
  727.  
  728. rb.ZIndex = 10
  729.  
  730. rb.Size = UDim2.new(0,2,1,-2)
  731.  
  732. rb.BackgroundColor3 = Color3.new(0,0,0)
  733.  
  734. rb.BackgroundTransparency = .5
  735.  
  736. rb.BorderColor3 = Color3.new(.4,.4,.4)
  737.  
  738. rb.Name = "b"
  739.  
  740. local g = r:Clone()
  741.  
  742. g.Parent = fr
  743.  
  744. g.Position = UDim2.new(0,5,0,25)
  745.  
  746. local b = r:Clone()
  747.  
  748. b.Parent = fr
  749.  
  750. b.Position = UDim2.new(0,5,0,45)
  751.  
  752. r.ZIndex,g.ZIndex,b.ZIndex = 10,10,10
  753.  
  754. local prev = Instance.new("TextButton",fr)
  755.  
  756. prev.Size = UDim2.new(0,55,0,45)
  757.  
  758. prev.Position = UDim2.new(0,90,0,5)
  759.  
  760. prev.ZIndex = 10
  761.  
  762. prev.BorderColor3 = Color3.new(.2,.2,.2)
  763.  
  764. prev.TextColor3 = Color3.new(1,1,1)
  765.  
  766. prev.TextStrokeTransparency = .4
  767.  
  768. prev.TextYAlignment = "Bottom"
  769.  
  770. prev.FontSize = "Size8"
  771.  
  772. prev.TextWrapped = true
  773.  
  774. local res = Instance.new("TextButton",fr)
  775.  
  776. res.Size = UDim2.new(0,55,0,9)
  777.  
  778. res.Position = UDim2.new(0,90,0,51)
  779.  
  780. res.ZIndex = 10
  781.  
  782. res.BorderColor3 = Color3.new(.2,.2,.2)
  783.  
  784. res.BackgroundColor3 = Color3.new(.5,0,0)
  785.  
  786. res.TextColor3 = Color3.new(1,1,1)
  787.  
  788. res.Text = "reset"
  789.  
  790. res.FontSize = "Size8"
  791.  
  792. local mode = 0
  793.  
  794. local function update(set)
  795.  
  796. r.b.Position = UDim2.new(rval,-1,0,1)
  797.  
  798. g.b.Position = UDim2.new(gval,-1,0,1)
  799.  
  800. b.b.Position = UDim2.new(bval,-1,0,1)
  801.  
  802. local col = Color3.new(rval,gval,bval)
  803.  
  804. prev.BackgroundColor3 = mode == 1 and mycolor2 or mycolor
  805.  
  806. prev.Text = ""
  807.  
  808. r.Text = math.floor(rval*255+.5)
  809.  
  810. g.Text = math.floor(gval*255+.5)
  811.  
  812. b.Text = math.floor(bval*255+.5)
  813.  
  814. for i,v in pairs(r:GetChildren()) do
  815.  
  816. local n = tonumber(v.Name)
  817.  
  818. if n then
  819.  
  820. local sc = n/am
  821.  
  822. v.BackgroundColor3 = Color3.new(sc,gval,bval)
  823.  
  824. end
  825.  
  826. end
  827.  
  828. for i,v in pairs(g:GetChildren()) do
  829.  
  830. local n = tonumber(v.Name)
  831.  
  832. if n then
  833.  
  834. local sc = n/am
  835.  
  836. v.BackgroundColor3 = Color3.new(rval,sc,bval)
  837.  
  838. end
  839.  
  840. end
  841.  
  842. for i,v in pairs(b:GetChildren()) do
  843.  
  844. local n = tonumber(v.Name)
  845.  
  846. if n then
  847.  
  848. local sc = n/am
  849.  
  850. v.BackgroundColor3 = Color3.new(rval,gval,sc)
  851.  
  852. end
  853.  
  854. end
  855.  
  856. if set ~= false then
  857.  
  858. if mode == 0 then
  859.  
  860. mycolor = col
  861.  
  862. end
  863.  
  864. if mode == 1 then
  865.  
  866. mycolor2 = col
  867.  
  868. end
  869.  
  870. changeColor()
  871.  
  872. end
  873.  
  874. end
  875.  
  876. update()
  877.  
  878. local rd,gd,bd = false,false,false
  879.  
  880. r.MouseButton1Down:connect(function(x,y) rd = true rval = (x-r.AbsolutePosition.X)/r.AbsoluteSize.X update() end)
  881.  
  882. r.MouseButton1Up:connect(function() rd = false end)
  883.  
  884. r.MouseLeave:connect(function() rd = false end)
  885.  
  886. r.MouseMoved:connect(function(x,y) if not rd then return end rval = (x-r.AbsolutePosition.X)/r.AbsoluteSize.X update() end)
  887.  
  888. g.MouseButton1Down:connect(function(x,y) gd = true gval = (x-g.AbsolutePosition.X)/g.AbsoluteSize.X update() end)
  889.  
  890. g.MouseButton1Up:connect(function() gd = false end)
  891.  
  892. g.MouseLeave:connect(function() gd = false end)
  893.  
  894. g.MouseMoved:connect(function(x,y) if not gd then return end gval = (x-g.AbsolutePosition.X)/g.AbsoluteSize.X update() end)
  895.  
  896. b.MouseButton1Down:connect(function(x,y) bd = true bval = (x-b.AbsolutePosition.X)/b.AbsoluteSize.X update() end)
  897.  
  898. b.MouseButton1Up:connect(function() bd = false end)
  899.  
  900. b.MouseLeave:connect(function() bd = false end)
  901.  
  902. b.MouseMoved:connect(function(x,y) if not bd then return end bval = (x-b.AbsolutePosition.X)/b.AbsoluteSize.X update() end)
  903.  
  904. res.MouseButton1Click:connect(function()
  905.  
  906. rval,gval,bval = themeColor.Color.r,themeColor.Color.g,themeColor.Color.b
  907.  
  908. update()
  909.  
  910. end)
  911.  
  912.  
  913. local modebtn = Instance.new("TextButton",fr)
  914.  
  915. modebtn.Position = UDim2.new(1,-150,0,-15)
  916.  
  917. modebtn.Size = UDim2.new(0,49,0,14)
  918.  
  919. modebtn.BackgroundColor3 = Color3.new(1,1,0)
  920.  
  921. modebtn.BackgroundTransparency = .6
  922.  
  923. modebtn.TextScaled = true
  924.  
  925. modebtn.Font = 4
  926.  
  927. modebtn.TextColor3 = Color3.new(1,1,1)
  928.  
  929. modebtn.TextStrokeTransparency = .7
  930.  
  931. modebtn.Text = "Body"
  932.  
  933. modebtn.MouseButton1Click:connect(function()
  934.  
  935. mode = (mode+1)%2
  936.  
  937. local col = mode == 1 and mycolor2 or mycolor
  938.  
  939. rval,gval,bval = col.r,col.g,col.b
  940.  
  941. modebtn.Text = mode == 0 and "Body" or "Clothes"
  942.  
  943. update(false)
  944.  
  945. end)
  946.  
  947.  
  948. local outfitbtn = Instance.new("TextButton",fr)
  949.  
  950. outfitbtn.Position = UDim2.new(1,-150,0,-30)
  951.  
  952. outfitbtn.Size = UDim2.new(0,49,0,14)
  953.  
  954. outfitbtn.BackgroundColor3 = Color3.new(1,1,0)
  955.  
  956. outfitbtn.BackgroundTransparency = .6
  957.  
  958. outfitbtn.TextScaled = true
  959.  
  960. outfitbtn.Font = 4
  961.  
  962. outfitbtn.TextColor3 = Color3.new(1,1,1)
  963.  
  964. outfitbtn.TextStrokeTransparency = .7
  965.  
  966. outfitbtn.Text = "Outfit"
  967.  
  968. outfitbtn.MouseButton1Click:connect(function()
  969.  
  970. outfit = (outfit+1)%(#outfits+1)
  971.  
  972. setOutfit()
  973.  
  974. end)
  975.  
  976.  
  977. local sparklebtn = Instance.new("TextButton",fr)
  978.  
  979. sparklebtn.Position = UDim2.new(1,-100,0,-15)
  980.  
  981. sparklebtn.Size = UDim2.new(0,100,0,14)
  982.  
  983. sparklebtn.BackgroundColor3 = Color3.new(0,1,0)
  984.  
  985. sparklebtn.BackgroundTransparency = .6
  986.  
  987. sparklebtn.TextScaled = true
  988.  
  989. sparklebtn.Font = 4
  990.  
  991. sparklebtn.TextColor3 = Color3.new(1,1,1)
  992.  
  993. sparklebtn.TextStrokeTransparency = .7
  994.  
  995. sparklebtn.Text = "Sparkles"
  996.  
  997. sparklebtn.MouseButton1Click:connect(function()
  998.  
  999. senabled = not senabled
  1000.  
  1001. sparklebtn.BackgroundColor3 = senabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  1002.  
  1003. end)
  1004.  
  1005. local lightbtn = Instance.new("TextButton",fr)
  1006.  
  1007. lightbtn.Position = UDim2.new(1,-100,0,-30)
  1008.  
  1009. lightbtn.Size = UDim2.new(0,100,0,14)
  1010.  
  1011. lightbtn.BackgroundColor3 = Color3.new(0,1,0)
  1012.  
  1013. lightbtn.BackgroundTransparency = .6
  1014.  
  1015. lightbtn.TextScaled = true
  1016.  
  1017. lightbtn.Font = 4
  1018.  
  1019. lightbtn.TextColor3 = Color3.new(1,1,1)
  1020.  
  1021. lightbtn.TextStrokeTransparency = .7
  1022.  
  1023. lightbtn.Text = "Light"
  1024.  
  1025. lightbtn.MouseButton1Click:connect(function()
  1026.  
  1027. lenabled = not lenabled
  1028.  
  1029. lightbtn.BackgroundColor3 = lenabled and Color3.new(0,1,0) or Color3.new(1,0,0)
  1030.  
  1031. end)
  1032.  
  1033. end
  1034.  
  1035.  
  1036.  
  1037. local gyro = root:FindFirstChild("RootGyro") or Instance.new("BodyGyro",root)
  1038.  
  1039. gyro.maxTorque = Vector3.new()
  1040.  
  1041. gyro.Name = "RootGyro"
  1042.  
  1043.  
  1044. local vel = root:FindFirstChild("RootVel") or Instance.new("BodyVelocity",root)
  1045.  
  1046. vel.maxForce = Vector3.new()
  1047.  
  1048. vel.Name = "RootVel"
  1049.  
  1050. vel.P = 4000
  1051.  
  1052.  
  1053. local flying = false
  1054.  
  1055. local state = "idle"
  1056.  
  1057. local kd = {}
  1058.  
  1059. local humspd = 0
  1060.  
  1061. local flyspeed = 0
  1062.  
  1063. local flystop = 0
  1064.  
  1065. local sitting = false
  1066.  
  1067. local holding = false
  1068.  
  1069.  
  1070. m.KeyDown:connect(function(k)
  1071.  
  1072. local now = tick()
  1073.  
  1074. kd[k] = now
  1075.  
  1076. if k == " " and not flying then
  1077.  
  1078. pcall(function() sitting:Destroy() end)
  1079.  
  1080. sitting = nil
  1081.  
  1082. state = "fly"
  1083.  
  1084. flying = true
  1085.  
  1086. flydir = (root.CFrame.lookVector*Vector3.new(1,0,1)).unit
  1087.  
  1088. elseif k == " " and state == "fly" then
  1089.  
  1090. flying = false
  1091.  
  1092. state = "idle"
  1093.  
  1094. flystop = tick()
  1095.  
  1096. elseif k == "x" and m.Target and (root.Position-m.Hit.p).magnitude < 20*modelScale then
  1097.  
  1098. local tar = m.Target
  1099.  
  1100. local cf = tar.CFrame:toObjectSpace(m.Hit)
  1101.  
  1102. local siz = tar.Size/2
  1103.  
  1104. local cfr
  1105.  
  1106. local rx,ry,rz = 0,0,0
  1107.  
  1108. local lv = tar.CFrame:vectorToObjectSpace(root.CFrame.lookVector)
  1109.  
  1110. if math.abs(cf.Y-siz.Y) < .03 then
  1111.  
  1112. cfr = CFrame.new(cf.p + Vector3.new(0,3*modelScale,0)) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),0)
  1113.  
  1114. elseif math.abs(-cf.Y-siz.Y) < .03 then
  1115.  
  1116. cfr = CFrame.new(cf.p - Vector3.new(0,3*modelScale,0)) * CFrame.Angles(0,math.atan2(-lv.X,-lv.Z),math.pi)
  1117.  
  1118. elseif math.abs(cf.X-siz.X) < .03 then
  1119.  
  1120. 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)
  1121.  
  1122. elseif math.abs(-cf.X-siz.X) < .03 then
  1123.  
  1124. 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)
  1125.  
  1126. elseif math.abs(cf.Z-siz.Z) < .03 then
  1127.  
  1128. 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)
  1129.  
  1130. elseif math.abs(-cf.Z-siz.Z) < .03 then
  1131.  
  1132. 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)
  1133.  
  1134. end
  1135.  
  1136. if cfr then
  1137.  
  1138. pcall(function() sitting:Destroy() end)
  1139.  
  1140. flying = false
  1141.  
  1142. state = "sit"
  1143.  
  1144. if m.Target.Anchored then
  1145.  
  1146. sitting = {tar = tar, cf = cfr}
  1147.  
  1148. else
  1149.  
  1150. sitting = weld(tar,root,cfr)
  1151.  
  1152. end
  1153.  
  1154. end
  1155.  
  1156. end
  1157.  
  1158. end)
  1159.  
  1160. m.KeyUp:connect(function(k)
  1161.  
  1162. kd[k] = nil
  1163.  
  1164. end)
  1165.  
  1166.  
  1167. hum.Running:connect(function(spd)
  1168.  
  1169. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  1170.  
  1171. humspd = spd
  1172.  
  1173. state = flying and "fly" or (spd < 1 and "idle" or "walk")
  1174.  
  1175. end)
  1176.  
  1177. hum.Climbing:connect(function(spd)
  1178.  
  1179. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  1180.  
  1181. humspd = spd
  1182.  
  1183. state = flying and "fly" or (spd < 1 and "idle" or "walk")
  1184.  
  1185. end)
  1186.  
  1187. hum.Seated:connect(function(a)
  1188.  
  1189. state = a and "sit" or humspd > 0 and "idle" or "walk"
  1190.  
  1191. end)
  1192.  
  1193.  
  1194. hum.Changed:connect(function()
  1195.  
  1196. if hum.Jump then
  1197.  
  1198. hum.Jump = false
  1199.  
  1200. end
  1201.  
  1202. end)
  1203.  
  1204.  
  1205. hum.FreeFalling:connect(function()
  1206.  
  1207. if state ~= "idle" and state ~= "walk" and state ~= "inair" then return end
  1208.  
  1209. state = math.abs(tor.Velocity.Y) > 1 and "inair" or state
  1210.  
  1211. end)
  1212.  
  1213.  
  1214. hum.FallingDown:connect(function(a)
  1215.  
  1216. if not a then return end
  1217.  
  1218. state = "inair"
  1219.  
  1220. end)
  1221.  
  1222.  
  1223.  
  1224.  
  1225. while true do
  1226.  
  1227. runservice.RenderStepped:wait()
  1228.  
  1229. local cam = workspace.CurrentCamera
  1230.  
  1231. local alpha = .2
  1232.  
  1233. sparkles.Enabled = senabled and flying and tor.Velocity.magnitude > 3
  1234.  
  1235. pl.Enabled = lenabled
  1236.  
  1237. if state ~= "fly" then
  1238.  
  1239. if type(sitting) == "table" then
  1240.  
  1241. gyro.maxTorque = Vector3.new(1,1,1)*4e6
  1242.  
  1243. vel.maxForce = Vector3.new(1,1,1)*4e5
  1244.  
  1245. gyro.cframe = sitting.tar.CFrame * sitting.cf
  1246.  
  1247. vel.velocity = (gyro.cframe.p-root.Position)*10
  1248.  
  1249. else
  1250.  
  1251. gyro.maxTorque,vel.maxForce = Vector3.new(),Vector3.new()
  1252.  
  1253. end
  1254.  
  1255. end
  1256.  
  1257. if sitting then
  1258.  
  1259. state = "sit"
  1260.  
  1261. end
  1262.  
  1263. tw.MaxVelocity,rh.MaxVelocity,lh.MaxVelocity,rs.MaxVelocity,ls.MaxVelocity,nk.MaxVelocity = 0,0,0,0,0,0
  1264.  
  1265. tw.CurrentAngle,rh.CurrentAngle,lh.CurrentAngle,rs.CurrentAngle,ls.CurrentAngle,nk.CurrentAngle = 0,0,0,0,0,0
  1266.  
  1267.  
  1268. local hasRobe = outfit == 1
  1269.  
  1270.  
  1271. if state == "idle" then
  1272.  
  1273. hum.PlatformStand = false
  1274.  
  1275. local breathing = math.sin(tick()*2)
  1276.  
  1277. local tilt = .02 + breathing*.03
  1278.  
  1279. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  1280.  
  1281. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  1282.  
  1283.  
  1284. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  1285.  
  1286. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt,hasRobe and 0 or -.1,hasRobe and 0 or .06),alpha)
  1287.  
  1288. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt,hasRobe and 0 or .1,hasRobe and 0 or -.06),alpha)
  1289.  
  1290. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt,0,.1),alpha)
  1291.  
  1292. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt,0,-.1),alpha)
  1293.  
  1294. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.05-.03,0,0),alpha)
  1295.  
  1296. elseif state == "inair" then
  1297.  
  1298. hum.PlatformStand = false
  1299.  
  1300. local wings = math.sin(tick()*80)
  1301.  
  1302. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.15+wings*.3,0),.6)
  1303.  
  1304. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.15-wings*.3,0),.6)
  1305.  
  1306. local alpha = .15
  1307.  
  1308. local tilt = .05
  1309.  
  1310. local wavey = math.sin(tick()*3)
  1311.  
  1312. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  1313.  
  1314. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+wavey*.1,0,hasRobe and 0 or .02),alpha)
  1315.  
  1316. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt-wavey*.1,0,hasRobe and 0 or -.02),alpha)
  1317.  
  1318. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt-wavey*.07,0,.01),alpha)
  1319.  
  1320. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+wavey*.07,0,-.01),alpha)
  1321.  
  1322. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+.2,0,0),alpha)
  1323.  
  1324. elseif state == "walk" then
  1325.  
  1326. hum.PlatformStand = false
  1327.  
  1328. local walking = math.sin(tick()*25)
  1329.  
  1330. local breathing = math.sin(tick()*2)
  1331.  
  1332. local tilt = -.03-breathing*.02+walking*.01
  1333.  
  1334. alpha = .6
  1335.  
  1336. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.05+breathing*.01+walking*.05,0),alpha)
  1337.  
  1338. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.05-breathing*.01+walking*.05,0),alpha)
  1339.  
  1340.  
  1341. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,-walking*.08,0),alpha)
  1342.  
  1343. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+walking*.3,0,hasRobe and 0 or .02),alpha)
  1344.  
  1345. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt-walking*.3,0,hasRobe and 0 or -.02),alpha)
  1346.  
  1347. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-tilt+.05-walking*.25,0,.01),alpha)
  1348.  
  1349. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(-tilt+.05+walking*.25,0,-.01),alpha)
  1350.  
  1351. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.04,walking*.07,0),alpha)
  1352.  
  1353. elseif state == "sit" then
  1354.  
  1355. hum.Sit = false
  1356.  
  1357. hum.PlatformStand = true
  1358.  
  1359. local breathing = math.sin(tick()*2)
  1360.  
  1361. local upvec = root.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))
  1362.  
  1363. if upvec.Y > .4 then
  1364.  
  1365. local tilt = -.55+breathing*.015
  1366.  
  1367. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  1368.  
  1369. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  1370.  
  1371. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0)+Vector3.new(0,-1.7,0)*modelScale,alpha)
  1372.  
  1373. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(-tilt+1.57,0,hasRobe and 0 or .6),alpha)
  1374.  
  1375. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-tilt+1.57,0,hasRobe and 0 or -.6),alpha)
  1376.  
  1377. 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)
  1378.  
  1379. 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)
  1380.  
  1381. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt+breathing*.04-.03,0,math.sin(tick()*4)*.06),alpha)
  1382.  
  1383. else -- wallhug
  1384.  
  1385. local breathing = math.sin(tick()*5)
  1386.  
  1387. local tilt = -1.55+breathing*.015
  1388.  
  1389. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.01+breathing*.01,0),alpha)
  1390.  
  1391. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.01-breathing*.01,0),alpha)
  1392.  
  1393. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0)+Vector3.new(0,-2.5,0)*modelScale,alpha)
  1394.  
  1395. 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)
  1396.  
  1397. 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)
  1398.  
  1399. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(2.9,0,.8)+Vector3.new(-.2,.4,0)*modelScale,alpha)
  1400.  
  1401. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(2.9,0,-.8)+Vector3.new(.2,.4,0)*modelScale,alpha)
  1402.  
  1403. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(breathing*.04+.7,0,0),alpha)
  1404.  
  1405. end
  1406.  
  1407. elseif state == "fly" then
  1408.  
  1409. hum.PlatformStand = true
  1410.  
  1411. gyro.maxTorque = Vector3.new(1,1,1)*4e6
  1412.  
  1413. vel.maxForce = Vector3.new(1,1,1)*4e5
  1414.  
  1415.  
  1416. 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))
  1417.  
  1418. velocity = cam.CoordinateFrame:vectorToWorldSpace(velocity)
  1419.  
  1420. local maxspeed = 40-(velocity.magnitude > 0 and velocity.unit.Y*20 or 0)
  1421.  
  1422. if velocity.magnitude > 0 then
  1423.  
  1424. flyspeed = lerp(flyspeed,maxspeed,.1)
  1425.  
  1426. flydir = flydir:Lerp(velocity.unit,.4).unit
  1427.  
  1428. hoverheight = nil
  1429.  
  1430. else
  1431.  
  1432. flyspeed = lerp(flyspeed,0,.3)
  1433.  
  1434. flydir = (flydir*Vector3.new(1,0,1)).unit
  1435.  
  1436. hoverheight = hoverheight or root.Position.Y
  1437.  
  1438. end
  1439.  
  1440. vel.velocity = flydir.unit * flyspeed
  1441.  
  1442. if hoverheight then
  1443.  
  1444. vel.velocity = vel.velocity + Vector3.new(0,hoverheight-root.Position.Y,0)
  1445.  
  1446. end
  1447.  
  1448. gyro.cframe = CFrame.new(Vector3.new(),flydir*Vector3.new(1,0,1))
  1449.  
  1450.  
  1451. rl.CanCollide,ll.CanCollide = true,true
  1452.  
  1453.  
  1454. local wings = math.sin(tick()*80)
  1455.  
  1456. w1.C0 = clerp(w1.C0,w10*CFrame.Angles(0,-.15+wings*.3,0),.6)
  1457.  
  1458. w2.C0 = clerp(w2.C0,w20*CFrame.Angles(0,.15-wings*.3,0),.6)
  1459.  
  1460. local alpha = .15
  1461.  
  1462. local flytilt = (flyspeed/maxspeed)
  1463.  
  1464. local tilt = flytilt*-1.4 + math.asin(gyro.cframe:vectorToObjectSpace(flydir).unit.Y)
  1465.  
  1466. local wavey = math.sin(tick()*6)
  1467.  
  1468. tw.C0 = clerp(tw.C0,c0.tw*CFrame.Angles(tilt,0,0),alpha)
  1469.  
  1470. rh.C0 = clerp(rh.C0,c0.rh*CFrame.Angles(wavey*.1,hasRobe and 0 or -.08,hasRobe and 0 or .1),alpha)
  1471.  
  1472. lh.C0 = clerp(lh.C0,c0.lh*CFrame.Angles(-wavey*.1,hasRobe and 0 or .08,hasRobe and 0 or -.1),alpha)
  1473.  
  1474. rs.C0 = clerp(rs.C0,c0.rs*CFrame.Angles(-wavey*.15,-.08,.1),alpha)
  1475.  
  1476. ls.C0 = clerp(ls.C0,c0.ls*CFrame.Angles(wavey*.15,.08,-.1),alpha)
  1477.  
  1478. nk.C0 = clerp(nk.C0,c0.nk*CFrame.Angles(-tilt*.8,0,0),alpha)
  1479.  
  1480. end
  1481.  
  1482. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement