DANIOS

horse

Mar 23rd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.08 KB | None | 0 0
  1.  
  2.  
  3. --[[
  4.  
  5. PROJECT: Horse
  6.  
  7. STARTDATE: 18/08/13
  8.  
  9. STARTDATE FOR DARKHORSE: 6/14/14
  10.  
  11. MAKERS OF HORSE: Penjuin3 and AntiBoomz0r
  12.  
  13. DARKHORSE CREATOR: ghostbusters43
  14.  
  15. ]]
  16.  
  17.  
  18.  
  19. Breeds = {
  20.  
  21. { -- Black
  22.  
  23. fur=BrickColor.new("Brown"),
  24.  
  25. mane=BrickColor.new("Brown"),
  26.  
  27. saddle=BrickColor.new("Brown"),
  28.  
  29. reins=BrickColor.new("Brown"),
  30.  
  31. hoof=BrickColor.new("Brown")
  32.  
  33. }
  34.  
  35. }
  36.  
  37.  
  38.  
  39. local Breed = Breeds[math.random(1,#Breeds)]
  40.  
  41.  
  42.  
  43. local ModelName = "Horse"
  44.  
  45. local ModelParent = workspace
  46.  
  47. --pcall(function() ModelParent[ModelName]:Destroy() end)
  48.  
  49.  
  50.  
  51. local ReinsHold = nil
  52.  
  53. local Height = 6.2
  54.  
  55. local rHeight = Height
  56.  
  57.  
  58.  
  59. local HasHat = false
  60.  
  61. local HatMeshId = "rbxassetid://42157240"
  62.  
  63. local HatTexId = ""
  64.  
  65. local HorseColor = Breed.fur
  66.  
  67. local EyeColor = BrickColor.new("Black")
  68.  
  69. local ManeColor = Breed.mane
  70.  
  71. local SaddleColor = Breed.saddle
  72.  
  73. local ReinsColor = Breed.reins
  74.  
  75. local HoofColor = Breed.hoof
  76.  
  77. local oc = oc or function(...) return ... end
  78.  
  79. local ModelScale = .6
  80.  
  81.  
  82.  
  83. local Speed = 0
  84.  
  85. local WalkSpeed = 15
  86.  
  87. local WalkSin = 6
  88.  
  89. local TrotSpeed = 30
  90.  
  91. local TrotSin = 4
  92.  
  93. local GallopSin = 60
  94.  
  95. local MaxSpeed = 70
  96.  
  97. local SpeedLimit = 70
  98.  
  99.  
  100.  
  101.  
  102.  
  103. local startpos = workspace.King_N3xul.Head.CFrame * CFrame.new(0,Height+1.5,10)--script.Parent:IsA("BasePart") and script.Parent.CFrame * CFrame.new(0,Height,0) or CFrame.new(0,Height+1,20)
  104.  
  105.  
  106.  
  107. math.randomseed(tick()+215819240)
  108.  
  109. math.random() math.random() math.random()
  110.  
  111. aran = function() return math.random() end
  112.  
  113. ran = function() return (math.random()-.5)*2 end
  114.  
  115.  
  116.  
  117. function Weld(a,b,c,d)
  118.  
  119. local w = Instance.new("Weld",a)
  120.  
  121. w.Part0 = a
  122.  
  123. w.Part1 = b
  124.  
  125. w.C0 = c or CFrame.new()
  126.  
  127. w.C1 = d or CFrame.new()
  128.  
  129. return w
  130.  
  131. end
  132.  
  133.  
  134.  
  135.  
  136.  
  137. do -- Ignore my clerp stuff stolen from stravvy
  138.  
  139. local function QuaternionFromCFrame(cf)
  140.  
  141. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  142.  
  143. local trace = m00 + m11 + m22
  144.  
  145. if trace > 0 then
  146.  
  147. local s = math.sqrt(1 + trace)
  148.  
  149. local recip = 0.5/s
  150.  
  151. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  152.  
  153. else
  154.  
  155. local i = 0
  156.  
  157. if m11 > m00 then
  158.  
  159. i = 1
  160.  
  161. end
  162.  
  163. if m22 > (i == 0 and m00 or m11) then
  164.  
  165. i = 2
  166.  
  167. end
  168.  
  169. if i == 0 then
  170.  
  171. local s = math.sqrt(m00-m11-m22+1)
  172.  
  173. local recip = 0.5/s
  174.  
  175. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  176.  
  177. elseif i == 1 then
  178.  
  179. local s = math.sqrt(m11-m22-m00+1)
  180.  
  181. local recip = 0.5/s
  182.  
  183. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  184.  
  185. elseif i == 2 then
  186.  
  187. local s = math.sqrt(m22-m00-m11+1)
  188.  
  189. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  190.  
  191. end
  192.  
  193. end
  194.  
  195. end
  196.  
  197. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  198.  
  199. local xs, ys, zs = x + x, y + y, z + z
  200.  
  201. local wx, wy, wz = w*xs, w*ys, w*zs
  202.  
  203. local xx = x*xs
  204.  
  205. local xy = x*ys
  206.  
  207. local xz = x*zs
  208.  
  209. local yy = y*ys
  210.  
  211. local yz = y*zs
  212.  
  213. local zz = z*zs
  214.  
  215. 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))
  216.  
  217. end
  218.  
  219. local function QuaternionSlerp(a, b, t)
  220.  
  221. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  222.  
  223. local startInterp, finishInterp;
  224.  
  225. if cosTheta >= 0.0001 then
  226.  
  227. if (1 - cosTheta) > 0.0001 then
  228.  
  229. local theta = math.acos(cosTheta)
  230.  
  231. local invSinTheta = 1/math.sin(theta)
  232.  
  233. startInterp = math.sin((1-t)*theta)*invSinTheta
  234.  
  235. finishInterp = math.sin(t*theta)*invSinTheta
  236.  
  237. else
  238.  
  239. startInterp = 1-t
  240.  
  241. finishInterp = t
  242.  
  243. end
  244.  
  245. else
  246.  
  247. if (1+cosTheta) > 0.0001 then
  248.  
  249. local theta = math.acos(-cosTheta)
  250.  
  251. local invSinTheta = 1/math.sin(theta)
  252.  
  253. startInterp = math.sin((t-1)*theta)*invSinTheta
  254.  
  255. finishInterp = math.sin(t*theta)*invSinTheta
  256.  
  257. else
  258.  
  259. startInterp = t-1
  260.  
  261. finishInterp = t
  262.  
  263. end
  264.  
  265. end
  266.  
  267. 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
  268.  
  269. end
  270.  
  271. function clerp(a,b,t)
  272.  
  273. local qa = {QuaternionFromCFrame(a)}
  274.  
  275. local qb = {QuaternionFromCFrame(b)}
  276.  
  277. local ax, ay, az = a.x, a.y, a.z
  278.  
  279. local bx, by, bz = b.x, b.y, b.z
  280.  
  281. local _t = 1-t
  282.  
  283. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  284.  
  285. end
  286.  
  287. end
  288.  
  289.  
  290.  
  291. function lerp(a,b,c)
  292.  
  293. return a+(b-a)*c
  294.  
  295. end
  296.  
  297.  
  298.  
  299. function ctlerp(c1,c2,al) -- Older, "worse" clerp if the other one fails..
  300.  
  301. local com1 = {c1:components()}
  302.  
  303. local com2 = {c2:components()}
  304.  
  305. for i,v in pairs(com1) do
  306.  
  307. com1[i] = lerp(v,com2[i],al)
  308.  
  309. end
  310.  
  311. return CFrame.new(unpack(com1))
  312.  
  313. end
  314.  
  315.  
  316.  
  317.  
  318.  
  319. local Model = Instance.new("Model",ModelParent)
  320.  
  321. Model.Name = ModelName
  322.  
  323.  
  324.  
  325. local BasePart = Instance.new("Part")
  326.  
  327. BasePart.FormFactor = "Custom"
  328.  
  329. BasePart.Size = Vector3.new()
  330.  
  331. BasePart.TopSurface,BasePart.BottomSurface,BasePart.LeftSurface,BasePart.RightSurface,BasePart.FrontSurface,BasePart.BackSurface = 10,10,10,10,10,10
  332.  
  333. BasePart:BreakJoints()
  334.  
  335. BasePart.CFrame = startpos
  336.  
  337.  
  338.  
  339. function NP()
  340.  
  341. local p = BasePart:Clone()
  342.  
  343. p.Parent = Model
  344.  
  345. return p
  346.  
  347. end
  348.  
  349.  
  350.  
  351. function Sphere(parent,scale)
  352.  
  353. local sm = Instance.new("SpecialMesh",parent)
  354.  
  355. sm.MeshType = "Sphere"
  356.  
  357. sm.Scale = scale or Vector3.new(1,1,1)
  358.  
  359. return sm
  360.  
  361. end
  362.  
  363.  
  364.  
  365. BasePart.BrickColor = HorseColor
  366.  
  367.  
  368.  
  369. local Main = NP()
  370.  
  371. Main.Size = Vector3.new(3.5,4.5,8)
  372.  
  373. Main.CFrame = startpos
  374.  
  375.  
  376.  
  377. MainMesh = Sphere(Main)
  378.  
  379.  
  380.  
  381. local Neck = NP()
  382.  
  383. Neck.Size = Vector3.new(2,5,2.5)
  384.  
  385. local NeckWeld = Weld(Main,Neck,CFrame.new(0,0.5,-3.2)*CFrame.Angles(math.rad(-20),0,0),CFrame.new(0,-1.5,0))
  386.  
  387. local NeckWeld0 = NeckWeld.C0
  388.  
  389. Sphere(Neck,Vector3.new(1,1,1))
  390.  
  391.  
  392.  
  393. local NeckBonus = NP()
  394.  
  395. NeckBonus.Size = Vector3.new(1.9,3,2)
  396.  
  397. Weld(Neck,NeckBonus,CFrame.new(0,-1.1,.5)*CFrame.Angles(-.5,0,0))
  398.  
  399. Sphere(NeckBonus)
  400.  
  401.  
  402.  
  403. local Head = NP()
  404.  
  405. Head.Size = Vector3.new(2,3,3)
  406.  
  407. local HeadWeld = Weld(Neck,Head,CFrame.new(0,2.5,-.4),CFrame.new(0,0,1))
  408.  
  409. local HeadWeld0 = HeadWeld.C0
  410.  
  411. local HeadMesh = Instance.new("SpecialMesh",Head)
  412.  
  413. HeadMesh.Scale = Vector3.new(0.7,1,1)*1.6
  414.  
  415. HeadMesh.MeshId = "http://www.roblox.com/asset/?id=114690930"
  416.  
  417.  
  418.  
  419. if HasHat then
  420.  
  421. local Hat = NP()
  422.  
  423. Hat.Size = Vector3.new()
  424.  
  425. Hat.BrickColor = SaddleColor
  426.  
  427. local HatWeld = Weld(Head,Hat,CFrame.new(0,1.11,1.3),CFrame.Angles(math.rad(-20),0,0))
  428.  
  429. local HatMesh = Instance.new("SpecialMesh",Hat)
  430.  
  431. HatMesh.Scale = Vector3.new(1.5,1.5,1.5)
  432.  
  433. HatMesh.MeshId = HatMeshId or "rbxassetid://42157240"
  434.  
  435. HatMesh.TextureId = HatTexId or ""
  436.  
  437. end
  438.  
  439.  
  440.  
  441. local EyeR = NP()
  442.  
  443. EyeR.BrickColor = EyeColor
  444.  
  445. EyeR.Reflectance = .1
  446.  
  447. EyeR.Size = Vector3.new(.2,.2,.2)
  448.  
  449. Weld(Head,EyeR,CFrame.new(.631,.23,.11)*CFrame.Angles(-0.2,0.1,0))
  450.  
  451. Sphere(EyeR,Vector3.new(.9,2.1,2.1))
  452.  
  453.  
  454.  
  455. local EyeL = NP()
  456.  
  457. EyeL.BrickColor = EyeColor
  458.  
  459. EyeL.Reflectance = .1
  460.  
  461. EyeL.Size = Vector3.new(.2,.2,.2)
  462.  
  463. Weld(Head,EyeL,CFrame.new(-.631,.23,.11)*CFrame.Angles(-0.2,-0.1,0))
  464.  
  465. Sphere(EyeL,Vector3.new(.9,2.1,2.1))
  466.  
  467.  
  468.  
  469. BasePart.Name = "Reins"
  470.  
  471.  
  472.  
  473. local RPart = NP() -- rs1
  474.  
  475. RPart.BrickColor = ReinsColor
  476.  
  477. RPart.Size = Vector3.new(.2,.7,.25)
  478.  
  479. Weld(Head,RPart,CFrame.new(.4,-.5,-1.05)*CFrame.Angles(-.25,0,0))
  480.  
  481.  
  482.  
  483. local Cyl = NP()
  484.  
  485. Cyl.BrickColor = ReinsColor
  486.  
  487. Cyl.Size = Vector3.new(.2495,.2,.2)
  488.  
  489. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  490.  
  491. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  492.  
  493.  
  494.  
  495. local RPart = NP() -- rs2
  496.  
  497. RPart.BrickColor = ReinsColor
  498.  
  499. RPart.Size = Vector3.new(.2,.4,.25)
  500.  
  501. Weld(Head,RPart,CFrame.new(.4,-.5,-1.05)*CFrame.Angles(-.25,0,0)*CFrame.new(0,-.35,0)*CFrame.Angles(0,0,-.5)*CFrame.new(0,-.2,0))
  502.  
  503. RPP = Instance.new("Smoke")
  504.  
  505. RPP.Parent = RPart
  506.  
  507. RPP.Opacity = 0.045
  508.  
  509. RPP.RiseVelocity = 0
  510.  
  511. RPP.Size = 0.1
  512.  
  513.  
  514.  
  515. local Cyl = NP()
  516.  
  517. Cyl.BrickColor = ReinsColor
  518.  
  519. Cyl.Size = Vector3.new(.2495,.2,.2)
  520.  
  521. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  522.  
  523. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  524.  
  525. local ReinAnchorR = Cyl
  526.  
  527.  
  528.  
  529. local RPart = NP() -- ls1
  530.  
  531. RPart.BrickColor = ReinsColor
  532.  
  533. RPart.Size = Vector3.new(.2,.7,.25)
  534.  
  535. Weld(Head,RPart,CFrame.new(-.4,-.5,-1.05)*CFrame.Angles(-.25,0,0))
  536.  
  537.  
  538.  
  539. local Cyl = NP()
  540.  
  541. Cyl.BrickColor = ReinsColor
  542.  
  543. Cyl.Size = Vector3.new(.2495,.2,.2)
  544.  
  545. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  546.  
  547. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  548.  
  549.  
  550.  
  551. local RPart = NP() -- ls2
  552.  
  553. RPart.BrickColor = ReinsColor
  554.  
  555. RPart.Size = Vector3.new(.2,.4,.25)
  556.  
  557. Weld(Head,RPart,CFrame.new(-.4,-.5,-1.05)*CFrame.Angles(-.25,0,0)*CFrame.new(0,-.35,0)*CFrame.Angles(0,0,.5)*CFrame.new(0,-.2,0))
  558.  
  559.  
  560.  
  561. local Cyl = NP()
  562.  
  563. Cyl.BrickColor = ReinsColor
  564.  
  565. Cyl.Size = Vector3.new(.2495,.2,.2)
  566.  
  567. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  568.  
  569. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  570.  
  571. local ReinAnchorL = Cyl
  572.  
  573.  
  574.  
  575. local RPart = NP() -- mb
  576.  
  577. RPart.BrickColor = ReinsColor
  578.  
  579. RPart.Size = Vector3.new(.5,.2,.249)
  580.  
  581. Weld(Head,RPart,CFrame.new(0,-.5,-1.05)*CFrame.Angles(-.25,0,0)*CFrame.new(0,-.65,0))
  582.  
  583.  
  584.  
  585. local Cyl = NP()
  586.  
  587. Cyl.BrickColor = ReinsColor
  588.  
  589. Cyl.Size = Vector3.new(.2495,.2,.2)
  590.  
  591. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  592.  
  593. Weld(RPart,Cyl,CFrame.new(RPart.Size.X/2,0,0)*CFrame.Angles(0,math.pi/2,0))
  594.  
  595.  
  596.  
  597. local Cyl = NP()
  598.  
  599. Cyl.BrickColor = ReinsColor
  600.  
  601. Cyl.Size = Vector3.new(.2495,.2,.2)
  602.  
  603. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  604.  
  605. Weld(RPart,Cyl,CFrame.new(-RPart.Size.X/2,0,0)*CFrame.Angles(0,math.pi/2,0))
  606.  
  607.  
  608.  
  609. local RPart = NP() -- mt
  610.  
  611. RPart.BrickColor = ReinsColor
  612.  
  613. RPart.Size = Vector3.new(.8,.2,.249)
  614.  
  615. Weld(Head,RPart,CFrame.new(0,-.5,-1.05)*CFrame.Angles(-.25,0,0)*CFrame.new(0,.35,0))
  616.  
  617.  
  618.  
  619. local RPart = NP()
  620.  
  621. RPart.BrickColor = ReinsColor
  622.  
  623. local sm = Instance.new("SpecialMesh",RPart)
  624.  
  625. sm.MeshType = "Sphere"
  626.  
  627. local ReinSphereL = Weld(Main,RPart,CFrame.new(-1,3,0))
  628.  
  629.  
  630.  
  631. local RPart = NP()
  632.  
  633. RPart.BrickColor = ReinsColor
  634.  
  635. local sm = Instance.new("SpecialMesh",RPart)
  636.  
  637. sm.MeshType = "Cylinder"
  638.  
  639. local ReinLineL = Weld(Main,RPart,CFrame.new(-1,3,-1))
  640.  
  641.  
  642.  
  643. local RPart = NP()
  644.  
  645. RPart.BrickColor = ReinsColor
  646.  
  647. local sm = Instance.new("SpecialMesh",RPart)
  648.  
  649. sm.MeshType = "Cylinder"
  650.  
  651. local ReinSphereR = Weld(Main,RPart,CFrame.new(1,3,0))
  652.  
  653.  
  654.  
  655. local RPart = NP()
  656.  
  657. RPart.BrickColor = ReinsColor
  658.  
  659. local sm = Instance.new("SpecialMesh",RPart)
  660.  
  661. sm.MeshType = "Cylinder"
  662.  
  663. local ReinLineR = Weld(Main,RPart,CFrame.new(1,3,-1))
  664.  
  665.  
  666.  
  667. local RPart = NP()
  668.  
  669. RPart.BrickColor = ReinsColor
  670.  
  671. local sm = Instance.new("SpecialMesh",RPart)
  672.  
  673. sm.MeshType = "Cylinder"
  674.  
  675. local ReinLineM = Weld(Main,RPart,CFrame.new(0,3,0))
  676.  
  677.  
  678.  
  679. BasePart.Name = "Part"
  680.  
  681.  
  682.  
  683. local Tail = NP()
  684.  
  685. Tail.BrickColor = ManeColor
  686.  
  687. Tail.CanCollide = false
  688.  
  689. Tail.Transparency = 1
  690.  
  691. Tail.Size = Vector3.new(0.8,4.5,0.8)
  692.  
  693. local TailWeld = Weld(Main,Tail,CFrame.new(0,.88,3.4)*CFrame.Angles(0,math.rad(10),0),CFrame.new(0,-2.3,0)*CFrame.Angles(math.rad(-130),0,0))
  694.  
  695. local TailWeld0 = TailWeld.C0
  696.  
  697. local TailHairs = {}
  698.  
  699. for i=1,8 do
  700.  
  701. local t = NP()
  702.  
  703. t.CanCollide = false
  704.  
  705. t.BrickColor = Tail.BrickColor
  706.  
  707. t.Size = Vector3.new(.4+aran()*.2,5.5-i*.1,.4+aran()*.2)
  708.  
  709. local tw = Weld(Tail,t,CFrame.new(0,-Tail.Size.Y/2,0)*CFrame.Angles(ran()*.15,ran()*.5,ran()*.15)*CFrame.new(ran()*.1,0,ran()*.1),CFrame.new(0,-t.Size.Y/2+.05,0))
  710.  
  711. table.insert(TailHairs,{w=tw,c0=tw.C0})
  712.  
  713. end
  714.  
  715. local BackHairs = {}
  716.  
  717. for i=0,10 do
  718.  
  719. if i<1 or i>7 then
  720.  
  721. local x = (i/10)
  722.  
  723. local m = NP()
  724.  
  725. m.CanCollide = false
  726.  
  727. m.BrickColor = ManeColor
  728.  
  729. m.Size = Vector3.new(.6+aran()*.2+math.sin(x*2.7)*.5,.9+ran()*.1,.9+ran()*.1)
  730.  
  731. if i<1 then m.Size = m.Size*0.7 end
  732.  
  733. local tw = Weld(Main,m,CFrame.new(0,.9+math.sin(x*2.8)*1.2,3.4-x*6),CFrame.Angles(ran()*.1,aran()*.1,ran()*.2))
  734.  
  735. table.insert(BackHairs,{w=tw,c0=tw.C0})
  736.  
  737. end
  738.  
  739. end
  740.  
  741.  
  742.  
  743.  
  744.  
  745. local NeckHairs = {}
  746.  
  747. for i=0,6 do
  748.  
  749. local x = (i/6)
  750.  
  751. local m = NP()
  752.  
  753. m.CanCollide = false
  754.  
  755. m.BrickColor = ManeColor
  756.  
  757. m.Size = Vector3.new(.8+ran()*.2,.7+ran()*.1,.9+ran()*.1)
  758.  
  759. local tw = Weld(Neck,m,CFrame.new(0,-1.3+x*3.5,1+math.sin(.55+x*3.7)*.5),CFrame.Angles(ran()*.08,aran()*.15,ran()*.08))
  760.  
  761. table.insert(NeckHairs ,{w=tw,c0=tw.C0})
  762.  
  763. end
  764.  
  765.  
  766.  
  767.  
  768.  
  769. local HeadHairs = {}
  770.  
  771. for i=0,6 do
  772.  
  773. local x = math.min(1,(i/3))
  774.  
  775. local m = NP()
  776.  
  777. m.CanCollide = false
  778.  
  779. m.BrickColor = ManeColor
  780.  
  781. if HasHat then m.Transparency = 1 end
  782.  
  783. m.Size = Vector3.new(.95+ran()*.2,1,.4)
  784.  
  785. local tw = Weld(Head,m,CFrame.new(0,-.8+x*1.6,2.02-i*.23)*CFrame.Angles(-.2-i*.3,0,0),CFrame.Angles(ran()*.08,aran()*.03,ran()*.08))
  786.  
  787. table.insert(HeadHairs ,{w=tw,c0=tw.C0})
  788.  
  789. end
  790.  
  791.  
  792.  
  793. local LHip = NP()
  794.  
  795. LHip.Size = Vector3.new(1.5,3.7,3.5)
  796.  
  797. Weld(Main,LHip,CFrame.new(-1,-.5,2.2)*CFrame.Angles(0,.35,0))
  798.  
  799. Sphere(LHip)
  800.  
  801.  
  802.  
  803. local LThigh = NP()
  804.  
  805. LThigh.CanCollide = false
  806.  
  807. LThigh.Size = Vector3.new(1.6,4,2.2)
  808.  
  809. local BL1 = Weld(LHip,LThigh,CFrame.new(-.05,.3,-.5)*CFrame.Angles(0,-.35,0)*CFrame.Angles(0,0,0),CFrame.new(0,1.7,0))
  810.  
  811. Sphere(LThigh)
  812.  
  813.  
  814.  
  815. local LBCannon = NP()
  816.  
  817. LBCannon.CanCollide = false
  818.  
  819. LBCannon.Size = Vector3.new(1,2.8,1)
  820.  
  821. local sm = Instance.new("SpecialMesh",LBCannon)
  822.  
  823. sm.MeshType = "Head"
  824.  
  825. local BL2 = Weld(LThigh,LBCannon,CFrame.new(0,-LThigh.Size.Y/2+.4,-.05)*CFrame.Angles(0,0,0),CFrame.new(0,1.3,0))
  826.  
  827.  
  828.  
  829. local LBKnee = NP()
  830.  
  831. LBKnee.CanCollide = false
  832.  
  833. LBKnee.Size = Vector3.new(1,1,1)
  834.  
  835. local sm = Instance.new("SpecialMesh",LBKnee)
  836.  
  837. sm.MeshType = "Sphere"
  838.  
  839. Weld(LBCannon,LBKnee,CFrame.new(0,LBCannon.Size.Y/2-.1,0))
  840.  
  841.  
  842.  
  843. local LBHoof = NP()
  844.  
  845. LBHoof.BrickColor = HoofColor
  846.  
  847. LBHoof.CanCollide = false
  848.  
  849. LBHoof.Size = Vector3.new(1,.7,1)
  850.  
  851. Instance.new("CylinderMesh",LBHoof)
  852.  
  853. local BL3 = Weld(LBCannon,LBHoof,CFrame.new(0,-LBCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  854.  
  855.  
  856.  
  857. local Hoof = NP()
  858.  
  859. Hoof.BrickColor = HoofColor
  860.  
  861. Hoof.CanCollide = false
  862.  
  863. Hoof.Size = Vector3.new(.2,.699,.5)
  864.  
  865. Weld(LBHoof,Hoof,CFrame.new(.4,0,.25))
  866.  
  867. local Hoof = NP()
  868.  
  869. Hoof.BrickColor = HoofColor
  870.  
  871. Hoof.CanCollide = false
  872.  
  873. Hoof.Size = Vector3.new(.2,.699,.5)
  874.  
  875. Weld(LBHoof,Hoof,CFrame.new(-.4,0,.25))
  876.  
  877.  
  878.  
  879. local RHip = NP()
  880.  
  881. RHip.Size = Vector3.new(1.5,3.7,3.5)
  882.  
  883. Weld(Main,RHip,CFrame.new(1,-.5,2.2)*CFrame.Angles(0,-.35,0))
  884.  
  885. Sphere(RHip)
  886.  
  887.  
  888.  
  889. local RThigh = NP()
  890.  
  891. RThigh.CanCollide = false
  892.  
  893. RThigh.Size = Vector3.new(1.6,4,2.2)
  894.  
  895. local BR1 = Weld(RHip,RThigh,CFrame.new(.05,.3,-.4)*CFrame.Angles(0,.35,0)*CFrame.Angles(0,0,0),CFrame.new(0,1.7,0))
  896.  
  897. Sphere(RThigh)
  898.  
  899.  
  900.  
  901. local RBCannon = NP()
  902.  
  903. RBCannon.CanCollide = false
  904.  
  905. RBCannon.Size = Vector3.new(1,2.8,1)
  906.  
  907. local sm = Instance.new("SpecialMesh",RBCannon)
  908.  
  909. sm.MeshType = "Head"
  910.  
  911. local BR2 = Weld(RThigh,RBCannon,CFrame.new(0,-RThigh.Size.Y/2+.4,-.05)*CFrame.Angles(0,0,0),CFrame.new(0,1.3,0))
  912.  
  913.  
  914.  
  915. local RBKnee = NP()
  916.  
  917. RBKnee.CanCollide = false
  918.  
  919. RBKnee.Size = Vector3.new(1,1,1)
  920.  
  921. local sm = Instance.new("SpecialMesh",RBKnee)
  922.  
  923. sm.MeshType = "Sphere"
  924.  
  925. Weld(RBCannon,RBKnee,CFrame.new(0,RBCannon.Size.Y/2-.1,0))
  926.  
  927.  
  928.  
  929. local RBHoof = NP()
  930.  
  931. RBHoof.BrickColor = HoofColor
  932.  
  933. RBHoof.CanCollide = false
  934.  
  935. RBHoof.Size = Vector3.new(1,.7,1)
  936.  
  937. Instance.new("CylinderMesh",RBHoof)
  938.  
  939. local BR3 = Weld(RBCannon,RBHoof,CFrame.new(0,-RBCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  940.  
  941.  
  942.  
  943. local Hoof = NP()
  944.  
  945. Hoof.BrickColor = HoofColor
  946.  
  947. Hoof.CanCollide = false
  948.  
  949. Hoof.Size = Vector3.new(.2,.699,.5)
  950.  
  951. Weld(RBHoof,Hoof,CFrame.new(.4,0,.25))
  952.  
  953. local Hoof = NP()
  954.  
  955. Hoof.BrickColor = HoofColor
  956.  
  957. Hoof.CanCollide = false
  958.  
  959. Hoof.Size = Vector3.new(.2,.699,.5)
  960.  
  961. Weld(RBHoof,Hoof,CFrame.new(-.4,0,.25))
  962.  
  963.  
  964.  
  965. local LShoulder = NP()
  966.  
  967. LShoulder.Size = Vector3.new(1.5,2.5,2)
  968.  
  969. Weld(Main,LShoulder,CFrame.new(-.9,-.5,-2.4)*CFrame.Angles(0,.15,0))
  970.  
  971. Sphere(LShoulder)
  972.  
  973.  
  974.  
  975. local LForearm = NP()
  976.  
  977. LForearm.CanCollide = false
  978.  
  979. LForearm.Size = Vector3.new(1.2,3.5,1.5)
  980.  
  981. local FL1 = Weld(LShoulder,LForearm,CFrame.new(-.1,.2,.1)*CFrame.Angles(0,0,0),CFrame.new(0,1.45,0))
  982.  
  983. Sphere(LForearm)
  984.  
  985.  
  986.  
  987. local LFCannon = NP()
  988.  
  989. LFCannon.CanCollide = false
  990.  
  991. LFCannon.Size = Vector3.new(.8,2.8,.8)
  992.  
  993. local sm = Instance.new("SpecialMesh",LFCannon)
  994.  
  995. sm.MeshType = "Head"
  996.  
  997. local FL2 = Weld(LForearm,LFCannon,CFrame.new(0,-LForearm.Size.Y/2+.4,-.05)*CFrame.Angles(0,0,0),CFrame.new(0,1.3,0))
  998.  
  999.  
  1000.  
  1001. local LFKnee= NP()
  1002.  
  1003. LFKnee.CanCollide = false
  1004.  
  1005. LFKnee.Size = Vector3.new(.8,.8,.8)
  1006.  
  1007. local sm = Instance.new("SpecialMesh",LFKnee)
  1008.  
  1009. sm.MeshType = "Sphere"
  1010.  
  1011. Weld(LFCannon,LFKnee,CFrame.new(0,LFCannon.Size.Y/2-.1,0))
  1012.  
  1013.  
  1014.  
  1015. local LFHoof = NP()
  1016.  
  1017. LFHoof.BrickColor = HoofColor
  1018.  
  1019. LFHoof.CanCollide = false
  1020.  
  1021. LFHoof.Size = Vector3.new(.8,.6,.8)
  1022.  
  1023. Instance.new("CylinderMesh",LFHoof)
  1024.  
  1025. local FL3 = Weld(LFCannon,LFHoof,CFrame.new(0,-LFCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  1026.  
  1027.  
  1028.  
  1029. local Hoof = NP()
  1030.  
  1031. Hoof.BrickColor = HoofColor
  1032.  
  1033. Hoof.CanCollide = false
  1034.  
  1035. Hoof.Size = Vector3.new(.2,.599,.4)
  1036.  
  1037. Weld(LFHoof,Hoof,CFrame.new(.3,0,.2))
  1038.  
  1039. local Hoof = NP()
  1040.  
  1041. Hoof.BrickColor = HoofColor
  1042.  
  1043. Hoof.CanCollide = false
  1044.  
  1045. Hoof.Size = Vector3.new(.2,.599,.4)
  1046.  
  1047. Weld(LFHoof,Hoof,CFrame.new(-.3,0,.2))
  1048.  
  1049.  
  1050.  
  1051. local RShoulder = NP()
  1052.  
  1053. RShoulder.Size = Vector3.new(1.5,2.5,2)
  1054.  
  1055. Weld(Main,RShoulder,CFrame.new(.9,-.5,-2.4)*CFrame.Angles(0,-.15,0))
  1056.  
  1057. Sphere(RShoulder)
  1058.  
  1059.  
  1060.  
  1061. local RForearm = NP()
  1062.  
  1063. RForearm.CanCollide = false
  1064.  
  1065. RForearm.Size = Vector3.new(1.2,3.5,1.5)
  1066.  
  1067. local FR1 = Weld(RShoulder,RForearm,CFrame.new(.1,.2,-.1)*CFrame.Angles(0,0,0),CFrame.new(0,1.45,0))
  1068.  
  1069. Sphere(RForearm)
  1070.  
  1071.  
  1072.  
  1073. local RFCannon = NP()
  1074.  
  1075. RFCannon.CanCollide = false
  1076.  
  1077. RFCannon.Size = Vector3.new(.8,2.8,.8)
  1078.  
  1079. local sm = Instance.new("SpecialMesh",RFCannon)
  1080.  
  1081. sm.MeshType = "Head"
  1082.  
  1083. local FR2 = Weld(RForearm,RFCannon,CFrame.new(0,-RForearm.Size.Y/2+.4,-.05)*CFrame.Angles(0,0,0),CFrame.new(0,1.3,0))
  1084.  
  1085.  
  1086.  
  1087. local RFKnee= NP()
  1088.  
  1089. RFKnee.CanCollide = false
  1090.  
  1091. RFKnee.Size = Vector3.new(.8,.8,.8)
  1092.  
  1093. local sm = Instance.new("SpecialMesh",RFKnee)
  1094.  
  1095. sm.MeshType = "Sphere"
  1096.  
  1097. Weld(RFCannon,RFKnee,CFrame.new(0,RFCannon.Size.Y/2-.1,0))
  1098.  
  1099.  
  1100.  
  1101. local RFHoof = NP()
  1102.  
  1103. RFHoof.BrickColor = HoofColor
  1104.  
  1105. RFHoof.CanCollide = false
  1106.  
  1107. RFHoof.Size = Vector3.new(.8,.6,.8)
  1108.  
  1109. Instance.new("CylinderMesh",RFHoof)
  1110.  
  1111. local FR3 = Weld(RFCannon,RFHoof,CFrame.new(0,-RFCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  1112.  
  1113.  
  1114.  
  1115. local Hoof = NP()
  1116.  
  1117. Hoof.BrickColor = HoofColor
  1118.  
  1119. Hoof.CanCollide = false
  1120.  
  1121. Hoof.Size = Vector3.new(.2,.599,.4)
  1122.  
  1123. Weld(RFHoof,Hoof,CFrame.new(.3,0,.2))
  1124.  
  1125. local Hoof = NP()
  1126.  
  1127. Hoof.BrickColor = HoofColor
  1128.  
  1129. Hoof.CanCollide = false
  1130.  
  1131. Hoof.Size = Vector3.new(.2,.599,.4)
  1132.  
  1133. Weld(RFHoof,Hoof,CFrame.new(-.3,0,.2))
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141. Seat = Instance.new("VehicleSeat",Model)
  1142.  
  1143. Seat.TopSurface,Seat.BottomSurface,Seat.LeftSurface,Seat.RightSurface,Seat.FrontSurface,Seat.BackSurface = 10,10,10,10,10,10
  1144.  
  1145. Seat.Size = Vector3.new(2,1.2,.5)
  1146.  
  1147. Seat.HeadsUpDisplay = false
  1148.  
  1149. Seat.CanCollide = false
  1150.  
  1151. Seat:BreakJoints()
  1152.  
  1153. Seat.Transparency = 1
  1154.  
  1155. Seat.CFrame = Main.CFrame
  1156.  
  1157. SeatWeld = Weld(Main,Seat,CFrame.new(0,2.5,-.5),CFrame.new(0,0,0))
  1158.  
  1159. local SeatWeld0 = SeatWeld.C0
  1160.  
  1161.  
  1162.  
  1163. Seat2 = Instance.new("Seat",Model)
  1164.  
  1165. Seat2.TopSurface,Seat2.BottomSurface,Seat2.LeftSurface,Seat2.RightSurface,Seat2.FrontSurface,Seat2.BackSurface = 10,10,10,10,10,10
  1166.  
  1167. Seat2.Size = Vector3.new(2,1.2,.5)
  1168.  
  1169. Seat2.CanCollide = false
  1170.  
  1171. Seat2.CFrame = Main.CFrame
  1172.  
  1173. Seat2:BreakJoints()
  1174.  
  1175. Seat2.Transparency = 1
  1176.  
  1177. Weld(Seat2,Seat,CFrame.new(0,0,-1.8))
  1178.  
  1179.  
  1180.  
  1181. SaddleMain = NP()
  1182.  
  1183. SaddleMain.Size = Vector3.new(2,1,3.5)
  1184.  
  1185. SaddleMain.BrickColor = SaddleColor
  1186.  
  1187. Sphere(SaddleMain)
  1188.  
  1189. Weld(Seat,SaddleMain,CFrame.new(0,-0.5,0.6))
  1190.  
  1191.  
  1192.  
  1193. SaddleFront = NP()
  1194.  
  1195. SaddleFront.Size = Vector3.new(1.6,1,0.3)
  1196.  
  1197. SaddleFront.BrickColor = SaddleColor
  1198.  
  1199. Sphere(SaddleFront)
  1200.  
  1201. Weld(SaddleMain,SaddleFront,CFrame.new(0,0.4,-1.4)*CFrame.Angles(math.rad(-30),0,0))
  1202.  
  1203.  
  1204.  
  1205. SaddleBack = NP()
  1206.  
  1207. SaddleBack.Size = Vector3.new(1.6,1,0.5)
  1208.  
  1209. SaddleBack.BrickColor = SaddleColor
  1210.  
  1211. Sphere(SaddleBack)
  1212.  
  1213. Weld(SaddleMain,SaddleBack,CFrame.new(0,0.3,1.4)*CFrame.Angles(math.rad(30),0,0))
  1214.  
  1215.  
  1216.  
  1217. SaddleFlankR = NP()
  1218.  
  1219. SaddleFlankR.Size = Vector3.new(0.3,1.7,1.8)
  1220.  
  1221. SaddleFlankR.BrickColor = SaddleColor
  1222.  
  1223. Sphere(SaddleFlankR)
  1224.  
  1225. Weld(SaddleMain,SaddleFlankR,CFrame.new(1.5,-0.8,0),CFrame.new(0.1,-0.7,0)*CFrame.Angles(0,0,math.rad(-30)))
  1226.  
  1227.  
  1228.  
  1229. SaddleFlankL = NP()
  1230.  
  1231. SaddleFlankL.Size = Vector3.new(0.3,1.7,1.8)
  1232.  
  1233. SaddleFlankL.BrickColor = SaddleColor
  1234.  
  1235. Sphere(SaddleFlankL)
  1236.  
  1237. Weld(SaddleMain,SaddleFlankL,CFrame.new(-1.5,-0.8,0),CFrame.new(-0.1,-0.7,0)*CFrame.Angles(0,0,math.rad(30)))
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245. local sWeld1,sWeld2;
  1246.  
  1247.  
  1248.  
  1249. Seat.DescendantAdded:connect(function(obj)
  1250.  
  1251. if obj.Name == "SeatWeld" then
  1252.  
  1253. sWeld1 = obj
  1254.  
  1255. torso2 = obj.Part1.Parent.Torso
  1256.  
  1257. local Torso = obj.Part1.Parent.Torso
  1258.  
  1259. obj.C0 = obj.C0*CFrame.new(0,0,-1.5)
  1260.  
  1261. local lhipr = Torso:FindFirstChild("Left Hip")
  1262.  
  1263. local rhipr = Torso:FindFirstChild("Right Hip")
  1264.  
  1265. if not lhipr or not rhipr then game:service'Debris':addItem(obj,.1) return end
  1266.  
  1267. for i,v in pairs(Model:GetChildren()) do
  1268.  
  1269. if v.Name == "Reins" and v:IsA("BasePart") then
  1270.  
  1271. v.Transparency = Main.Transparency
  1272.  
  1273. end
  1274.  
  1275. end
  1276.  
  1277. local lh0,lh1 = lhipr.Part0,lhipr.Part1
  1278.  
  1279. local rh0,rh1 = rhipr.Part0,rhipr.Part1
  1280.  
  1281. lhipr.Part0,lhipr.Part1 = nil,nil
  1282.  
  1283. rhipr.Part0,rhipr.Part1 = nil,nil
  1284.  
  1285. local lhip = lhipr:Clone()
  1286.  
  1287. lhip.Name = "LH"
  1288.  
  1289. lhip.Parent = lhipr.Parent
  1290.  
  1291. lhip.Part0,lhip.Part1 = lh0,lh1
  1292.  
  1293. local rhip = rhipr:Clone()
  1294.  
  1295. rhip.Name = "RH"
  1296.  
  1297. rhip.Parent = rhipr.Parent
  1298.  
  1299. rhip.Part0,rhip.Part1 = rh0,rh1
  1300.  
  1301. lhip.DesiredAngle = 0
  1302.  
  1303. rhip.DesiredAngle = 0
  1304.  
  1305. local lhip0,lhip1,rhip0,rhip1 = lhip.C0,lhip.C1,rhip.C0,rhip.C1
  1306.  
  1307. lhip.C0 = lhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(-40))
  1308.  
  1309. lhip.C1 = lhip1*CFrame.new(0.1,-0.2,0)
  1310.  
  1311. rhip.C0 = rhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(40))
  1312.  
  1313. rhip.C1 = rhip1*CFrame.new(-0.1,-0.2,0)
  1314.  
  1315. local toolOn = false
  1316.  
  1317. local toolAn = 0
  1318.  
  1319. local toolCon;
  1320.  
  1321. local toolChan;
  1322.  
  1323. local oc0 = obj.C0
  1324.  
  1325. local newChild = function(d)
  1326.  
  1327. local md = d:FindFirstChild("MouseDown")
  1328.  
  1329. if d:IsA("Tool") and md and md:IsA("BoolValue") then
  1330.  
  1331. pcall(function() toolChan:disconnect() end)
  1332.  
  1333. toolOn = false
  1334.  
  1335. toolChan = md.Changed:connect(function()
  1336.  
  1337. toolOn = md.Value
  1338.  
  1339. if not toolOn then return end
  1340.  
  1341. pcall(function() ReinsHold = CFrame.new(0,2,-1.7) end)
  1342.  
  1343. while toolOn and game:service'RunService'.Stepped:wait() do
  1344.  
  1345. toolAn = math.min(1,toolAn+.2)
  1346.  
  1347. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  1348.  
  1349. end
  1350.  
  1351. while not toolOn and game:service'RunService'.Stepped:wait() do
  1352.  
  1353. toolAn = math.max(0,toolAn-.2)
  1354.  
  1355. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  1356.  
  1357. if toolAn == 0 then break end
  1358.  
  1359. end
  1360.  
  1361. ReinsHold = nil
  1362.  
  1363. end)
  1364.  
  1365. end
  1366.  
  1367. end
  1368.  
  1369. local ctrlgui;
  1370.  
  1371. if Torso.Parent then
  1372.  
  1373. toolCon = Torso.Parent.ChildAdded:connect(newChild)
  1374.  
  1375. for i,v in pairs(Torso.Parent:GetChildren()) do
  1376.  
  1377. newChild(v)
  1378.  
  1379. end
  1380.  
  1381. local plr = game.Players:GetPlayerFromCharacter(Torso.Parent)
  1382.  
  1383. if plr then
  1384.  
  1385. ctrlgui = Instance.new("ScreenGui")
  1386.  
  1387. local fr = Instance.new("Frame",ctrlgui)
  1388.  
  1389. fr.Position = UDim2.new(1,0,.9,0)
  1390.  
  1391. fr.Size = UDim2.new(-.07,0,.02,0)
  1392.  
  1393. fr.BackgroundTransparency = 1
  1394.  
  1395. local function nbtn(text,indent)
  1396.  
  1397. for i,v in pairs(fr:GetChildren()) do
  1398.  
  1399. v.Position = v.Position - UDim2.new(0,0,1,1)
  1400.  
  1401. end
  1402.  
  1403. local tb = Instance.new("TextButton",fr)
  1404.  
  1405. tb.Size = UDim2.new(-1,4+(indent-1)*3,1,-4)
  1406.  
  1407. tb.Position = UDim2.new(1,2,0,2)
  1408.  
  1409. tb.BorderSizePixel = 3
  1410.  
  1411. tb.BackgroundColor3 = HorseColor.Color
  1412.  
  1413. tb.BorderColor3 = ManeColor.Color
  1414.  
  1415. tb.Text = " "..text.." "
  1416.  
  1417. tb.TextXAlignment = "Left"
  1418.  
  1419. tb.TextColor3 = Color3.new(1,1,1)
  1420.  
  1421. tb.TextStrokeTransparency = .6
  1422.  
  1423. tb.TextScaled = true
  1424.  
  1425. tb.ZIndex = 10
  1426.  
  1427. local il = Instance.new("ImageLabel",tb)
  1428.  
  1429. il.Size = UDim2.new(-1,2,1,-2)
  1430.  
  1431. il.Image = "rbxassetid://129465985"
  1432.  
  1433. il.SizeConstraint = "RelativeYY"
  1434.  
  1435. il.BackgroundTransparency = 1
  1436.  
  1437. il.Position = UDim2.new(1,0,0,2)
  1438.  
  1439. il.ZIndex = 10
  1440.  
  1441. return tb
  1442.  
  1443. end
  1444.  
  1445. nbtn("| Horse menu",1).AutoButtonColor = false
  1446.  
  1447. nbtn("- Max speed",2).AutoButtonColor = false
  1448.  
  1449. local gal = nbtn("~ Gallop",3)
  1450.  
  1451. local trot = nbtn("~ Trot",3)
  1452.  
  1453. local walk = nbtn("~ Walk",3)
  1454.  
  1455. local tar = (SpeedLimit == MaxSpeed and gal or SpeedLimit == TrotSpeed and trot or walk)
  1456.  
  1457. tar.BackgroundColor3 = Color3.new(0,.7,0)
  1458.  
  1459. gal.MouseButton1Down:connect(function()
  1460.  
  1461. gal.BackgroundColor3 = Color3.new(0,.7,0)
  1462.  
  1463. trot.BackgroundColor3 = HorseColor.Color
  1464.  
  1465. walk.BackgroundColor3 = HorseColor.Color
  1466.  
  1467. SpeedLimit = MaxSpeed
  1468.  
  1469. end)
  1470.  
  1471. trot.MouseButton1Down:connect(function()
  1472.  
  1473. gal.BackgroundColor3 = HorseColor.Color
  1474.  
  1475. trot.BackgroundColor3 = Color3.new(0,.7,0)
  1476.  
  1477. walk.BackgroundColor3 = HorseColor.Color
  1478.  
  1479. SpeedLimit = TrotSpeed
  1480.  
  1481. end)
  1482.  
  1483. walk.MouseButton1Down:connect(function()
  1484.  
  1485. gal.BackgroundColor3 = HorseColor.Color
  1486.  
  1487. trot.BackgroundColor3 = HorseColor.Color
  1488.  
  1489. walk.BackgroundColor3 = Color3.new(0,.7,0)
  1490.  
  1491. SpeedLimit = WalkSpeed
  1492.  
  1493. end)
  1494.  
  1495. pcall(function()
  1496.  
  1497. for i,v in pairs(plr:GetChildren()) do
  1498.  
  1499. pcall(function()
  1500.  
  1501. if v:IsA("PlayerGui") then
  1502.  
  1503. ctrlgui.Parent = v
  1504.  
  1505. end
  1506.  
  1507. end)
  1508.  
  1509. end
  1510.  
  1511. end)
  1512.  
  1513. end
  1514.  
  1515. end
  1516.  
  1517.  
  1518.  
  1519. obj.AncestryChanged:connect(function(c,p)
  1520.  
  1521. if c ~= obj or p == Seat then return end
  1522.  
  1523. lhip:Destroy()
  1524.  
  1525. rhip:Destroy()
  1526.  
  1527. lhipr.Part0,lhipr.Part1 = lh0,lh1
  1528.  
  1529. rhipr.Part0,rhipr.Part1 = rh0,rh1
  1530.  
  1531. obj:Destroy()
  1532.  
  1533. ReinsHold = nil
  1534.  
  1535. for i,v in pairs(Model:GetChildren()) do
  1536.  
  1537. if v.Name == "Reins" and v:IsA("BasePart") then
  1538.  
  1539. v.Transparency = 1
  1540.  
  1541. end
  1542.  
  1543. end
  1544.  
  1545. pcall(function() toolCon:disconnect() end)
  1546.  
  1547. pcall(function() toolChan:disconnect() end)
  1548.  
  1549. pcall(game.Destroy,ctrlgui)
  1550.  
  1551. end)
  1552.  
  1553. end
  1554.  
  1555. end)
  1556.  
  1557.  
  1558.  
  1559. Seat2.DescendantAdded:connect(function(obj)
  1560.  
  1561. if obj.Name == "SeatWeld" then
  1562.  
  1563. sWeld2 = obj
  1564.  
  1565. local Torso = obj.Part1.Parent.Torso
  1566.  
  1567. obj.C0 = obj.C0*CFrame.new(0,.5,-1.5)
  1568.  
  1569. local lhipr = Torso:FindFirstChild("Left Hip")
  1570.  
  1571. local rhipr = Torso:FindFirstChild("Right Hip")
  1572.  
  1573. if not lhipr or not rhipr then game:service'Debris':addItem(obj,.1) return end
  1574.  
  1575. local lh0,lh1 = lhipr.Part0,lhipr.Part1
  1576.  
  1577. local rh0,rh1 = rhipr.Part0,rhipr.Part1
  1578.  
  1579. lhipr.Part0,lhipr.Part1 = nil,nil
  1580.  
  1581. rhipr.Part0,rhipr.Part1 = nil,nil
  1582.  
  1583. local lhip = lhipr:Clone()
  1584.  
  1585. lhip.Name = "LH"
  1586.  
  1587. lhip.Parent = lhipr.Parent
  1588.  
  1589. lhip.Part0,lhip.Part1 = lh0,lh1
  1590.  
  1591. local rhip = rhipr:Clone()
  1592.  
  1593. rhip.Name = "RH"
  1594.  
  1595. rhip.Parent = rhipr.Parent
  1596.  
  1597. rhip.Part0,rhip.Part1 = rh0,rh1
  1598.  
  1599. lhip.DesiredAngle = 0
  1600.  
  1601. rhip.DesiredAngle = 0
  1602.  
  1603. local lhip0,lhip1,rhip0,rhip1 = lhip.C0,lhip.C1,rhip.C0,rhip.C1
  1604.  
  1605. lhip.C0 = lhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(-40))
  1606.  
  1607. lhip.C1 = lhip1*CFrame.new(0.1,-0.2,0)
  1608.  
  1609. rhip.C0 = rhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(40))
  1610.  
  1611. rhip.C1 = rhip1*CFrame.new(-0.1,-0.2,0)
  1612.  
  1613. local toolOn = false
  1614.  
  1615. local toolAn = 0
  1616.  
  1617. local toolCon;
  1618.  
  1619. local toolChan;
  1620.  
  1621. local oc0 = obj.C0
  1622.  
  1623. local newChild = function(d)
  1624.  
  1625. local md = d:FindFirstChild("MouseDown")
  1626.  
  1627. if d:IsA("Tool") and md and md:IsA("BoolValue") then
  1628.  
  1629. pcall(function() toolChan:disconnect() end)
  1630.  
  1631. toolOn = false
  1632.  
  1633. toolChan = md.Changed:connect(function()
  1634.  
  1635. toolOn = md.Value
  1636.  
  1637. if not toolOn then return end
  1638.  
  1639. while toolOn and game:service'RunService'.Stepped:wait() do
  1640.  
  1641. toolAn = math.min(1,toolAn+.2)
  1642.  
  1643. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  1644.  
  1645. end
  1646.  
  1647. while not toolOn and game:service'RunService'.Stepped:wait() do
  1648.  
  1649. toolAn = math.max(0,toolAn-.2)
  1650.  
  1651. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  1652.  
  1653. if toolAn == 0 then break end
  1654.  
  1655. end
  1656.  
  1657. end)
  1658.  
  1659. end
  1660.  
  1661. end
  1662.  
  1663. toolCon = Torso.Parent.ChildAdded:connect(newChild)
  1664.  
  1665. for i,v in pairs(Torso.Parent:GetChildren()) do
  1666.  
  1667. newChild(v)
  1668.  
  1669. end
  1670.  
  1671. obj.AncestryChanged:connect(function(c,p)
  1672.  
  1673. if c ~= obj or p == Seat2 then return end
  1674.  
  1675. lhip:Destroy()
  1676.  
  1677. rhip:Destroy()
  1678.  
  1679. lhipr.Part0,lhipr.Part1 = lh0,lh1
  1680.  
  1681. rhipr.Part0,rhipr.Part1 = rh0,rh1
  1682.  
  1683. obj:Destroy()
  1684.  
  1685. end)
  1686.  
  1687. end
  1688.  
  1689. end)
  1690.  
  1691.  
  1692.  
  1693. for i,v in pairs(Model:GetChildren()) do
  1694.  
  1695. if v.Name == "Reins" and v:IsA("BasePart") then
  1696.  
  1697. v.Transparency = 1
  1698.  
  1699. end
  1700.  
  1701. end
  1702.  
  1703.  
  1704.  
  1705. local Filler = NP()
  1706.  
  1707. Filler.Size = Vector3.new(3,4,7)
  1708.  
  1709. Filler.Transparency = 1
  1710.  
  1711. Weld(Main,Filler,CFrame.new(0,-2,0))
  1712.  
  1713.  
  1714.  
  1715. local BallB = NP()
  1716.  
  1717. BallB.CanCollide = true
  1718.  
  1719. BallB.Shape = "Ball"
  1720.  
  1721. BallB.Size = Vector3.new(3,3,3)
  1722.  
  1723. BallB.Transparency = 1
  1724.  
  1725. local BBW = Weld(Main,BallB,CFrame.new(0,-Height+BallB.Size.Y/2,3))
  1726.  
  1727. BBW0 = BBW.C0
  1728.  
  1729.  
  1730.  
  1731. local BallF = NP()
  1732.  
  1733. BallF.CanCollide = true
  1734.  
  1735. BallF.Shape = "Ball"
  1736.  
  1737. BallF.Size = Vector3.new(3,3,3)
  1738.  
  1739. BallF.Transparency = 1
  1740.  
  1741. local FBW = Weld(Main,BallF,CFrame.new(0,-Height+BallB.Size.Y/2,-3))
  1742.  
  1743. FBW0 = FBW.C0
  1744.  
  1745.  
  1746.  
  1747. local BG = Instance.new("BodyGyro",Main)
  1748.  
  1749. BG.cframe = Main.CFrame
  1750.  
  1751. local bgcf = BG.cframe
  1752.  
  1753. BG.maxTorque = Vector3.new(1,1,1)*4e6
  1754.  
  1755.  
  1756.  
  1757. local BF = Instance.new("BodyForce",Main)
  1758.  
  1759. BF.force = Vector3.new(0,10000,0)
  1760.  
  1761.  
  1762.  
  1763. local BV = Instance.new("BodyVelocity",Main)
  1764.  
  1765. BV.maxForce = Vector3.new(1,1,1)*4e6
  1766.  
  1767. BV.velocity = Vector3.new()
  1768.  
  1769. local bvvel = Vector3.new()
  1770.  
  1771.  
  1772.  
  1773. local Legs = {
  1774.  
  1775. FR1,FR2,FR3,
  1776.  
  1777. FL1,FL2,FL3,
  1778.  
  1779. BR1,BR2,BR3,
  1780.  
  1781. BL1,BL2,BL3,
  1782.  
  1783. }
  1784.  
  1785. local Legs0 = {}
  1786.  
  1787. for i,v in pairs(Legs) do
  1788.  
  1789. Legs0[i] = v.C0
  1790.  
  1791. end
  1792.  
  1793.  
  1794.  
  1795. function RayCast(Ray,Ignore)
  1796.  
  1797. local hit,p = workspace:FindPartOnRayWithIgnoreList(Ray,Ignore)
  1798.  
  1799. if not hit or hit.CanCollide then
  1800.  
  1801. return hit,p
  1802.  
  1803. elseif hit then
  1804.  
  1805. table.insert(Ignore,hit)
  1806.  
  1807. return RayCast(Ray,Ignore)
  1808.  
  1809. end
  1810.  
  1811. end
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817. --Model:MoveTo(startpos.p)
  1818.  
  1819.  
  1820.  
  1821. local climbangle = 0
  1822.  
  1823. local blinktimer = 0
  1824.  
  1825.  
  1826.  
  1827. --while game:GetService("RunService").Stepped:wait() do
  1828.  
  1829. local connection
  1830.  
  1831. connection = game:GetService("RunService").Stepped:connect(oc(function()
  1832.  
  1833. if not Model:IsDescendantOf(workspace) then
  1834.  
  1835. pcall(game.Destroy,Model)
  1836.  
  1837. pcall(game.Destroy,script)
  1838.  
  1839. connection:disconnect()
  1840.  
  1841. end
  1842.  
  1843. local th = Seat.Throttle
  1844.  
  1845. local st = Seat.Steer
  1846.  
  1847. local TailSin = math.sin(tick()*(th==1 and .5+Speed/MaxSpeed*6 or 2))
  1848.  
  1849. local BreathSin = math.sin(tick()*(th==1 and (Speed<=WalkSpeed and WalkSin/2 or Speed<=TrotSpeed and TrotSin/2 or GallopSin/2) or 2))
  1850.  
  1851. TailWeld.C0 = clerp(TailWeld.C0,TailWeld0 * CFrame.Angles(math.rad(th == 1 and 20+math.min(1,Speed/MaxSpeed)*(-50+TailSin*10) or th==-1 and 25 or 20),0,TailSin*.3),.15)
  1852.  
  1853.  
  1854.  
  1855. local d,un = 10;
  1856.  
  1857. if th == 0 and st == 0 then
  1858.  
  1859. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1860.  
  1861. pcall(function()
  1862.  
  1863. local dis = v:DistanceFromCharacter(Head.Position)
  1864.  
  1865. if dis < d then
  1866.  
  1867. local u = Main.CFrame:vectorToObjectSpace((v.Character.Head.Position-Head.Position).unit)
  1868.  
  1869. if u.Z < 0 then
  1870.  
  1871. d,un = dis,u
  1872.  
  1873. end
  1874.  
  1875. end
  1876.  
  1877. end)
  1878.  
  1879. end
  1880.  
  1881. end
  1882.  
  1883.  
  1884.  
  1885. if math.random(1,150) == 1 then
  1886.  
  1887. blinktimer = 4
  1888.  
  1889. end
  1890.  
  1891. if blinktimer > 0 then
  1892.  
  1893. EyeR.BrickColor = HorseColor
  1894.  
  1895. EyeL.BrickColor = HorseColor
  1896.  
  1897. blinktimer = blinktimer - 1
  1898.  
  1899. else
  1900.  
  1901. EyeR.BrickColor = EyeColor
  1902.  
  1903. EyeL.BrickColor = EyeColor
  1904.  
  1905. end
  1906.  
  1907. NeckWeld.C0 = clerp(NeckWeld.C0,CFrame.Angles(0,-st*.1-(un and math.sin(un.X)/2 or 0),-st*.1) *NeckWeld0 * CFrame.Angles(math.rad(BreathSin*2+(th==1 and -math.min(1,math.max(0,Speed-10)/(MaxSpeed-10))*45 or th == -1 and 10 or 0))+(un and math.sin(un.Y)/2 or 0),0,0),.15)
  1908.  
  1909. HeadWeld.C0 = clerp(HeadWeld.C0,CFrame.Angles(0,-st*.3-(un and math.sin(un.X)/2 or 0),-st*.1) *HeadWeld0 * CFrame.Angles(math.rad(BreathSin*-4+(th==1 and 10 or th == -1 and -30 or 0))+(un and math.sin(un.Y)/2 or 0),0,0),.15)
  1910.  
  1911. MainMesh.Scale = Vector3.new(1,1+(BreathSin*.025),1)
  1912.  
  1913. SeatWeld.C0 = SeatWeld0 + Vector3.new(0,BreathSin*.05,0)
  1914.  
  1915. bgcf = bgcf * CFrame.Angles(0,-st*.05,0)
  1916.  
  1917. BG.cframe = clerp(bgcf,bgcf * CFrame.Angles(0,0,th==1 and -st*(.1+Speed/MaxSpeed*.1) or 0),.1)*CFrame.Angles(climbangle,0,-st*.25*(Speed/MaxSpeed))
  1918.  
  1919. Speed = math.max(th==-1 and -WalkSpeed or th==1 and math.min(SpeedLimit,10) or 0,math.min(SpeedLimit,Speed+(th==1 and .25 or -3)))
  1920.  
  1921. updown = th==1 and Speed > TrotSpeed and math.abs(math.sin((tick()-.1)*3)) or math.max(0,(updown or 0)-.1)
  1922.  
  1923.  
  1924.  
  1925. local front = Main.CFrame*CFrame.new(0,0,-3)
  1926.  
  1927. local back = Main.CFrame*CFrame.new(0,0,3)
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933. local fHit,fP = RayCast(Ray.new(front.p,front:vectorToWorldSpace(Vector3.new(0,-Height*6,0))),{Model})
  1934.  
  1935.  
  1936.  
  1937. local fDiff = (front.p-fP).magnitude
  1938.  
  1939. if fDiff > Height*2 then
  1940.  
  1941. fHit = nil
  1942.  
  1943. end
  1944.  
  1945. local fY = math.max(fP.Y,front.Y-Height)
  1946.  
  1947.  
  1948.  
  1949. local bHit,bP = RayCast(Ray.new(back.p,back:vectorToWorldSpace(Vector3.new(0,-Height*6,0))),{Model})
  1950.  
  1951. local bDiff = (back.p-bP).magnitude
  1952.  
  1953. if bDiff > Height*2 then
  1954.  
  1955. bHit = nil
  1956.  
  1957. end
  1958.  
  1959. local bY = math.max(bP.Y,back.Y-Height)
  1960.  
  1961.  
  1962.  
  1963. local diffY = (fY+bY)/2-(Main.Position.Y-Height)
  1964.  
  1965.  
  1966.  
  1967. climbangle = fHit and bHit and math.asin((fP-bP).unit.Y) or climbangle*.5
  1968.  
  1969.  
  1970.  
  1971. bvvel = Main.CFrame.lookVector.unit * Speed
  1972.  
  1973. BV.velocity = (fP-bP).unit*Speed + Vector3.new(0,-(math.min(fDiff-Height,bDiff-Height)+updown*.8)*3,0)
  1974.  
  1975. BV.maxForce = Vector3.new(1,1,1)*4e6
  1976.  
  1977. BBW.C0 = BBW0 + Vector3.new(0,updown*.8,-1.4)
  1978.  
  1979. FBW.C0 = FBW0 + Vector3.new(0,updown*.8,1.4)
  1980.  
  1981.  
  1982.  
  1983. for i=1,#Legs,3 do
  1984.  
  1985. local ang = 0;
  1986.  
  1987. local ang2 = 0;
  1988.  
  1989. local ang3 = 0;
  1990.  
  1991. local time = tick()
  1992.  
  1993. if i < #Legs/2 then -- front
  1994.  
  1995. if i%6 == 1 then -- Right
  1996.  
  1997. if th == 1 then
  1998.  
  1999. if Speed <= WalkSpeed then -- walky
  2000.  
  2001. ang = math.sin(time*WalkSin)*.15 + .05
  2002.  
  2003. ang2 = -math.abs(math.cos(time*WalkSin/2))*.4
  2004.  
  2005. elseif Speed <= TrotSpeed then
  2006.  
  2007. ang = math.sin(time*TrotSin)*.5 + .4
  2008.  
  2009. ang2 = -math.abs(math.cos(time*TrotSin/2))*1.7
  2010.  
  2011. else
  2012.  
  2013. ang = math.sin(time*6)*.8 + .35
  2014.  
  2015. ang2 = -math.abs(math.cos(time*3))*1.8
  2016.  
  2017. end
  2018.  
  2019. elseif th == -1 then
  2020.  
  2021. ang = math.sin(time*6)*.3 +.25
  2022.  
  2023. time = time -.1
  2024.  
  2025. ang2 = -math.abs(math.sin(time*3))*1.3 +.2
  2026.  
  2027. else
  2028.  
  2029. ang = math.sin(tick()*2)*.5 + .5
  2030.  
  2031. ang2 = -math.abs(math.cos(tick()*1) )*1.5
  2032.  
  2033. ang3 = ang2
  2034.  
  2035. end
  2036.  
  2037. else -- left
  2038.  
  2039. if th == 1 then
  2040.  
  2041. if Speed <= WalkSpeed then -- walky
  2042.  
  2043. time = time + math.pi/WalkSin
  2044.  
  2045. ang = math.sin(time*WalkSin)*.15 + .05
  2046.  
  2047. ang2 = -math.abs(math.cos(time*WalkSin/2))*.4
  2048.  
  2049. elseif Speed <= TrotSpeed then
  2050.  
  2051. time = time + math.pi/TrotSin
  2052.  
  2053. ang = math.sin(time*TrotSin)*.5 + .4
  2054.  
  2055. ang2 = -math.abs(math.cos(time*TrotSin/2))*1.7
  2056.  
  2057. else
  2058.  
  2059. time = time + .15
  2060.  
  2061. ang = math.sin(time*6)*.8 + .35
  2062.  
  2063. ang2 = -math.abs(math.cos(time*3))*1.8
  2064.  
  2065. end
  2066.  
  2067. elseif th == -1 then
  2068.  
  2069. time = time + math.pi/2
  2070.  
  2071. ang = math.sin(time*6)*.3 +.25
  2072.  
  2073. time = time -.1
  2074.  
  2075. ang2 = -math.abs(math.sin(time*3))*1.3 +.2
  2076.  
  2077. else
  2078.  
  2079. end
  2080.  
  2081. end
  2082.  
  2083. else -- back
  2084.  
  2085. if i%6 == 1 then -- Right
  2086.  
  2087. if th == 1 then
  2088.  
  2089. if Speed <= WalkSpeed then -- walky
  2090.  
  2091. ang = math.sin(time*WalkSin)*.1 - .6
  2092.  
  2093. ang2 = math.abs(math.cos(time*WalkSin/2))*.5 + .4
  2094.  
  2095. elseif Speed <= TrotSpeed then
  2096.  
  2097. ang = math.sin(time*TrotSin)*.5 - .8
  2098.  
  2099. ang2 = math.abs(math.cos(time*TrotSin/2))*1.4 - .1
  2100.  
  2101. ang3 = ang2-1
  2102.  
  2103. else
  2104.  
  2105. time = time + math.pi/2
  2106.  
  2107. ang = math.sin(time*6)*.5 - .8
  2108.  
  2109. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  2110.  
  2111. ang3 = ang2-1
  2112.  
  2113. end
  2114.  
  2115. elseif th == -1 then
  2116.  
  2117. ang = math.sin(time*6)*.2 - .6
  2118.  
  2119. time = time -.5
  2120.  
  2121. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  2122.  
  2123. ang3 = math.sin(time*6)*.2
  2124.  
  2125. else
  2126.  
  2127. ang = -.5
  2128.  
  2129. ang2 = .65
  2130.  
  2131. ang3 = -.15
  2132.  
  2133. end
  2134.  
  2135. else -- left
  2136.  
  2137. if th == 1 then
  2138.  
  2139. if Speed <= WalkSpeed then -- walky
  2140.  
  2141. time = time + math.pi/WalkSin
  2142.  
  2143. ang = math.sin(time*WalkSin)*.1 - .7
  2144.  
  2145. ang2 = math.abs(math.cos(time*WalkSin/2))*.5 + .4
  2146.  
  2147. elseif Speed <= TrotSpeed then
  2148.  
  2149. time = time - math.pi/TrotSin
  2150.  
  2151. ang = math.sin(time*TrotSin)*.5 - .8
  2152.  
  2153. ang2 = math.abs(math.cos(time*TrotSin/2))*1.4 - .1
  2154.  
  2155. ang3 = ang2-1
  2156.  
  2157. else
  2158.  
  2159. time = time + math.pi/2 - .15
  2160.  
  2161. ang = math.sin(time*6)*.5 - .8
  2162.  
  2163. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  2164.  
  2165. ang3 = ang2-1
  2166.  
  2167. end
  2168.  
  2169. elseif th == -1 then
  2170.  
  2171. time = time + math.pi/2
  2172.  
  2173. ang = math.sin(time*6)*.2 - .6
  2174.  
  2175. time = time -.5
  2176.  
  2177. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  2178.  
  2179. ang3 = math.sin(time*6)*.2
  2180.  
  2181. else
  2182.  
  2183. ang = -.55
  2184.  
  2185. ang2 = .65
  2186.  
  2187. ang3 = -.1
  2188.  
  2189. end
  2190.  
  2191. end
  2192.  
  2193. end
  2194.  
  2195. Legs[i].C0 = clerp(Legs[i].C0,Legs0[i] * CFrame.Angles(ang,0,0), .2)
  2196.  
  2197. Legs[i+1].C0 =clerp(Legs[i+1].C0, Legs0[i+1] * CFrame.Angles(ang2,0,0), .2)
  2198.  
  2199. Legs[i+2].C0 = clerp(Legs[i+2].C0, Legs0[i+2] * CFrame.Angles(ang3,0,0), .2)
  2200.  
  2201. end
  2202.  
  2203.  
  2204.  
  2205. -- Reins
  2206.  
  2207. if ReinLineM and ReinLineM.Part1 and ReinLineM.Part1.Transparency < 1 then
  2208.  
  2209. local rHold = ReinsHold or CFrame.new(0,3.5,-2)
  2210.  
  2211. ReinSphereL.C0 = rHold*CFrame.new(-1.8,0,0) + Vector3.new(0,BreathSin*.05,0)
  2212.  
  2213. ReinSphereR.C0 = rHold*CFrame.new(1.8,0,0) + Vector3.new(0,BreathSin*.05,0)
  2214.  
  2215. local lp1 = Main.CFrame:pointToObjectSpace(ReinAnchorL.Position) + Vector3.new(-0.05,0,0)
  2216.  
  2217. local lp2 = ReinSphereL.C0.p
  2218.  
  2219. ReinLineL.C0 = CFrame.new(lp1:Lerp(lp2,.5),lp2)*CFrame.Angles(0,math.pi/2,0)
  2220.  
  2221. ReinLineL.Part1.Mesh.Scale = Vector3.new((lp2-lp1).magnitude/ReinLineL.Part1.Size.X,1,1)
  2222.  
  2223. local rp1 = Main.CFrame:pointToObjectSpace(ReinAnchorR.Position) + Vector3.new(0.05,0,0)
  2224.  
  2225. local rp2 = ReinSphereR.C0.p
  2226.  
  2227. ReinLineR.C0 = CFrame.new(rp1:Lerp(rp2,.5),rp2)*CFrame.Angles(0,math.pi/2,0)
  2228.  
  2229. ReinLineR.Part1.Mesh.Scale = Vector3.new((rp2-rp1).magnitude/ReinLineR.Part1.Size.X,1,1)
  2230.  
  2231. ReinLineM.C0 = CFrame.new(lp2:Lerp(rp2,.5),rp2)*CFrame.Angles(0,math.pi/2,0)
  2232.  
  2233. ReinLineM.Part1.Mesh.Scale = Vector3.new((rp2-lp2).magnitude/ReinLineM.Part1.Size.X,1,1)
  2234.  
  2235. end
  2236.  
  2237. for i,v in pairs(BackHairs) do
  2238.  
  2239. v.w.C0 = v.c0 * CFrame.Angles(math.sin(BreathSin+i)*.05,math.sin(BreathSin+i^2)*.05,math.sin(BreathSin+i^3)*.05) + Vector3.new(0,BreathSin*.05,0)
  2240.  
  2241. end
  2242.  
  2243. --[[
  2244.  
  2245. for i,v in pairs(TailHairs) do
  2246.  
  2247. v.w.C0 = v.c0 * CFrame.Angles(math.sin(TailSin+i)*.05,math.sin(TailSin+i^2)*.05,math.sin(TailSin+i^3)*.05)
  2248.  
  2249. end
  2250.  
  2251. for i,v in pairs(NeckHairs) do
  2252.  
  2253. v.w.C0 = v.c0 * CFrame.Angles(math.sin(BreathSin+i)*.05,math.sin(BreathSin+i^2)*.05,math.sin(BreathSin+i^3)*.05)
  2254.  
  2255. end
  2256.  
  2257. for i,v in pairs(HeadHairs) do
  2258.  
  2259. v.w.C0 = v.c0 * CFrame.Angles(math.sin(BreathSin+i)*.08,math.sin(BreathSin+i^2)*.08,math.sin(BreathSin+i^3)*.08)
  2260.  
  2261. end]]
  2262.  
  2263. end))
Add Comment
Please, Sign In to add comment