Advertisement
Victini

HORSSEEE

Aug 8th, 2015
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.23 KB | None | 0 0
  1. --[[
  2. load/horse/current/1337/666
  3. ]]
  4.  
  5. Breeds = {
  6. { -- Brown
  7. fur=BrickColor.new("Brown"),
  8. mane=BrickColor.new("Nougat"),
  9. saddle=BrickColor.Black(),
  10. reins=BrickColor.Black(),
  11. hoof=BrickColor.Black()
  12. },
  13. { -- Black
  14. fur=BrickColor.Black(),
  15. mane=BrickColor.new("Really black"),
  16. saddle=BrickColor.new("Brown"),
  17. reins=BrickColor.new("Brown"),
  18. hoof=BrickColor.new("Dark stone grey")
  19. },
  20. { -- Grey
  21. fur=BrickColor.new("Dark stone grey"),
  22. mane=BrickColor.Black(),
  23. saddle=BrickColor.new("Brown"),
  24. reins=BrickColor.new("Brown"),
  25. hoof=BrickColor.Black()
  26. },
  27. { -- White
  28. fur=BrickColor.new("Light stone grey"),
  29. mane=BrickColor.new("Medium stone grey"),
  30. saddle=BrickColor.Black(),
  31. reins=BrickColor.Black(),
  32. hoof=BrickColor.Black()
  33. }
  34. }
  35.  
  36. local Breed = Breeds[math.random(1,#Breeds)]
  37.  
  38. local ModelName = "Horse"
  39. local ModelParent = workspace
  40. --pcall(function() ModelParent[ModelName]:Destroy() end)
  41.  
  42. local ReinsHold = nil
  43. local Height = 6.2
  44. local rHeight = Height
  45.  
  46. local HasHat = true
  47. local HatMeshId = "rbxassetid://42157240"
  48. local HatTexId = ""
  49. local HorseColor = Breed.fur
  50. local EyeColor = BrickColor.new("Really black")
  51. local ManeColor = Breed.mane
  52. local SaddleColor = Breed.saddle
  53. local ReinsColor = Breed.reins
  54. local HoofColor = Breed.hoof
  55. local oc = oc or function(...) return ... end
  56. local ModelScale = .6
  57.  
  58. local Speed = 0
  59. local WalkSpeed = 18
  60. local WalkSin = 6
  61. local TrotSpeed = 35
  62. local TrotSin = 4
  63. local GallopSin = 50
  64. local MaxSpeed = 70
  65. local SpeedLimit = 70
  66.  
  67.  
  68. local startpos = workspace.ChaoticsTheHedgeHog.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)
  69.  
  70. math.randomseed(tick()+215819240)
  71. math.random() math.random() math.random()
  72. aran = function() return math.random() end
  73. ran = function() return (math.random()-.5)*2 end
  74.  
  75. function Weld(a,b,c,d)
  76. local w = Instance.new("Weld",a)
  77. w.Part0 = a
  78. w.Part1 = b
  79. w.C0 = c or CFrame.new()
  80. w.C1 = d or CFrame.new()
  81. return w
  82. end
  83.  
  84.  
  85. do -- Ignore my clerp stuff stolen from stravvy
  86. local function QuaternionFromCFrame(cf)
  87. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  88. local trace = m00 + m11 + m22
  89. if trace > 0 then
  90. local s = math.sqrt(1 + trace)
  91. local recip = 0.5/s
  92. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  93. else
  94. local i = 0
  95. if m11 > m00 then
  96. i = 1
  97. end
  98. if m22 > (i == 0 and m00 or m11) then
  99. i = 2
  100. end
  101. if i == 0 then
  102. local s = math.sqrt(m00-m11-m22+1)
  103. local recip = 0.5/s
  104. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  105. elseif i == 1 then
  106. local s = math.sqrt(m11-m22-m00+1)
  107. local recip = 0.5/s
  108. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  109. elseif i == 2 then
  110. local s = math.sqrt(m22-m00-m11+1)
  111. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  112. end
  113. end
  114. end
  115. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  116. local xs, ys, zs = x + x, y + y, z + z
  117. local wx, wy, wz = w*xs, w*ys, w*zs
  118. local xx = x*xs
  119. local xy = x*ys
  120. local xz = x*zs
  121. local yy = y*ys
  122. local yz = y*zs
  123. local zz = z*zs
  124. 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))
  125. end
  126. local function QuaternionSlerp(a, b, t)
  127. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  128. local startInterp, finishInterp;
  129. if cosTheta >= 0.0001 then
  130. if (1 - cosTheta) > 0.0001 then
  131. local theta = math.acos(cosTheta)
  132. local invSinTheta = 1/math.sin(theta)
  133. startInterp = math.sin((1-t)*theta)*invSinTheta
  134. finishInterp = math.sin(t*theta)*invSinTheta
  135. else
  136. startInterp = 1-t
  137. finishInterp = t
  138. end
  139. else
  140. if (1+cosTheta) > 0.0001 then
  141. local theta = math.acos(-cosTheta)
  142. local invSinTheta = 1/math.sin(theta)
  143. startInterp = math.sin((t-1)*theta)*invSinTheta
  144. finishInterp = math.sin(t*theta)*invSinTheta
  145. else
  146. startInterp = t-1
  147. finishInterp = t
  148. end
  149. end
  150. 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
  151. end
  152. function clerp(a,b,t)
  153. local qa = {QuaternionFromCFrame(a)}
  154. local qb = {QuaternionFromCFrame(b)}
  155. local ax, ay, az = a.x, a.y, a.z
  156. local bx, by, bz = b.x, b.y, b.z
  157. local _t = 1-t
  158. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  159. end
  160. end
  161.  
  162. function lerp(a,b,c)
  163. return a+(b-a)*c
  164. end
  165.  
  166. function ctlerp(c1,c2,al) -- Older, "worse" clerp if the other one fails..
  167. local com1 = {c1:components()}
  168. local com2 = {c2:components()}
  169. for i,v in pairs(com1) do
  170. com1[i] = lerp(v,com2[i],al)
  171. end
  172. return CFrame.new(unpack(com1))
  173. end
  174.  
  175.  
  176. local Model = Instance.new("Model",ModelParent)
  177. Model.Name = ModelName
  178.  
  179. local BasePart = Instance.new("Part")
  180. BasePart.FormFactor = "Custom"
  181. BasePart.Size = Vector3.new()
  182. BasePart.TopSurface,BasePart.BottomSurface,BasePart.LeftSurface,BasePart.RightSurface,BasePart.FrontSurface,BasePart.BackSurface = 10,10,10,10,10,10
  183. BasePart:BreakJoints()
  184. BasePart.CFrame = startpos
  185.  
  186. function NP()
  187. local p = BasePart:Clone()
  188. p.Parent = Model
  189. return p
  190. end
  191.  
  192. function Sphere(parent,scale)
  193. local sm = Instance.new("SpecialMesh",parent)
  194. sm.MeshType = "Sphere"
  195. sm.Scale = scale or Vector3.new(1,1,1)
  196. return sm
  197. end
  198.  
  199. BasePart.BrickColor = HorseColor
  200.  
  201. local Main = NP()
  202. Main.Size = Vector3.new(3.5,4.5,8)
  203. Main.CFrame = startpos
  204.  
  205. MainMesh = Sphere(Main)
  206.  
  207. local Neck = NP()
  208. Neck.Size = Vector3.new(2,5,2.5)
  209. 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))
  210. local NeckWeld0 = NeckWeld.C0
  211. Sphere(Neck,Vector3.new(1,1,1))
  212.  
  213. local NeckBonus = NP()
  214. NeckBonus.Size = Vector3.new(1.9,3,2)
  215. Weld(Neck,NeckBonus,CFrame.new(0,-1.1,.5)*CFrame.Angles(-.5,0,0))
  216. Sphere(NeckBonus)
  217.  
  218. local Head = NP()
  219. Head.Size = Vector3.new(2,3,3)
  220. local HeadWeld = Weld(Neck,Head,CFrame.new(0,2.5,-.4),CFrame.new(0,0,1))
  221. local HeadWeld0 = HeadWeld.C0
  222. local HeadMesh = Instance.new("SpecialMesh",Head)
  223. HeadMesh.Scale = Vector3.new(0.7,1,1)*1.6
  224. HeadMesh.MeshId = "http://www.roblox.com/asset/?id=114690930"
  225.  
  226. if HasHat then
  227. local Hat = NP()
  228. Hat.Size = Vector3.new()
  229. Hat.BrickColor = SaddleColor
  230. local HatWeld = Weld(Head,Hat,CFrame.new(0,1.11,1.3),CFrame.Angles(math.rad(-20),0,0))
  231. local HatMesh = Instance.new("SpecialMesh",Hat)
  232. HatMesh.Scale = Vector3.new(1.5,1.5,1.5)
  233. HatMesh.MeshId = HatMeshId or "rbxassetid://42157240"
  234. HatMesh.TextureId = HatTexId or ""
  235. end
  236.  
  237. local EyeR = NP()
  238. EyeR.BrickColor = EyeColor
  239. EyeR.Reflectance = .1
  240. EyeR.Size = Vector3.new(.2,.2,.2)
  241. Weld(Head,EyeR,CFrame.new(.631,.23,.11)*CFrame.Angles(-0.2,0.1,0))
  242. Sphere(EyeR,Vector3.new(.9,2.1,2.1))
  243.  
  244. local EyeL = NP()
  245. EyeL.BrickColor = EyeColor
  246. EyeL.Reflectance = .1
  247. EyeL.Size = Vector3.new(.2,.2,.2)
  248. Weld(Head,EyeL,CFrame.new(-.631,.23,.11)*CFrame.Angles(-0.2,-0.1,0))
  249. Sphere(EyeL,Vector3.new(.9,2.1,2.1))
  250.  
  251. BasePart.Name = "Reins"
  252.  
  253. local RPart = NP() -- rs1
  254. RPart.BrickColor = ReinsColor
  255. RPart.Size = Vector3.new(.2,.7,.25)
  256. Weld(Head,RPart,CFrame.new(.4,-.5,-1.05)*CFrame.Angles(-.25,0,0))
  257.  
  258. local Cyl = NP()
  259. Cyl.BrickColor = ReinsColor
  260. Cyl.Size = Vector3.new(.2495,.2,.2)
  261. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  262. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  263.  
  264. local RPart = NP() -- rs2
  265. RPart.BrickColor = ReinsColor
  266. RPart.Size = Vector3.new(.2,.4,.25)
  267. 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))
  268.  
  269. local Cyl = NP()
  270. Cyl.BrickColor = ReinsColor
  271. Cyl.Size = Vector3.new(.2495,.2,.2)
  272. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  273. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  274. local ReinAnchorR = Cyl
  275.  
  276. local RPart = NP() -- ls1
  277. RPart.BrickColor = ReinsColor
  278. RPart.Size = Vector3.new(.2,.7,.25)
  279. Weld(Head,RPart,CFrame.new(-.4,-.5,-1.05)*CFrame.Angles(-.25,0,0))
  280.  
  281. local Cyl = NP()
  282. Cyl.BrickColor = ReinsColor
  283. Cyl.Size = Vector3.new(.2495,.2,.2)
  284. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  285. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  286.  
  287. local RPart = NP() -- ls2
  288. RPart.BrickColor = ReinsColor
  289. RPart.Size = Vector3.new(.2,.4,.25)
  290. 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))
  291.  
  292. local Cyl = NP()
  293. Cyl.BrickColor = ReinsColor
  294. Cyl.Size = Vector3.new(.2495,.2,.2)
  295. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  296. Weld(RPart,Cyl,CFrame.new(0,RPart.Size.Y/2,0)*CFrame.Angles(0,math.pi/2,0))
  297. local ReinAnchorL = Cyl
  298.  
  299. local RPart = NP() -- mb
  300. RPart.BrickColor = ReinsColor
  301. RPart.Size = Vector3.new(.5,.2,.249)
  302. Weld(Head,RPart,CFrame.new(0,-.5,-1.05)*CFrame.Angles(-.25,0,0)*CFrame.new(0,-.65,0))
  303.  
  304. local Cyl = NP()
  305. Cyl.BrickColor = ReinsColor
  306. Cyl.Size = Vector3.new(.2495,.2,.2)
  307. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  308. Weld(RPart,Cyl,CFrame.new(RPart.Size.X/2,0,0)*CFrame.Angles(0,math.pi/2,0))
  309.  
  310. local Cyl = NP()
  311. Cyl.BrickColor = ReinsColor
  312. Cyl.Size = Vector3.new(.2495,.2,.2)
  313. Instance.new("SpecialMesh",Cyl).MeshType = "Cylinder"
  314. Weld(RPart,Cyl,CFrame.new(-RPart.Size.X/2,0,0)*CFrame.Angles(0,math.pi/2,0))
  315.  
  316. local RPart = NP() -- mt
  317. RPart.BrickColor = ReinsColor
  318. RPart.Size = Vector3.new(.8,.2,.249)
  319. Weld(Head,RPart,CFrame.new(0,-.5,-1.05)*CFrame.Angles(-.25,0,0)*CFrame.new(0,.35,0))
  320.  
  321. local RPart = NP()
  322. RPart.BrickColor = ReinsColor
  323. local sm = Instance.new("SpecialMesh",RPart)
  324. sm.MeshType = "Sphere"
  325. local ReinSphereL = Weld(Main,RPart,CFrame.new(-1,3,0))
  326.  
  327. local RPart = NP()
  328. RPart.BrickColor = ReinsColor
  329. local sm = Instance.new("SpecialMesh",RPart)
  330. sm.MeshType = "Cylinder"
  331. local ReinLineL = Weld(Main,RPart,CFrame.new(-1,3,-1))
  332.  
  333. local RPart = NP()
  334. RPart.BrickColor = ReinsColor
  335. local sm = Instance.new("SpecialMesh",RPart)
  336. sm.MeshType = "Sphere"
  337. local ReinSphereR = Weld(Main,RPart,CFrame.new(1,3,0))
  338.  
  339. local RPart = NP()
  340. RPart.BrickColor = ReinsColor
  341. local sm = Instance.new("SpecialMesh",RPart)
  342. sm.MeshType = "Cylinder"
  343. local ReinLineR = Weld(Main,RPart,CFrame.new(1,3,-1))
  344.  
  345. local RPart = NP()
  346. RPart.BrickColor = ReinsColor
  347. local sm = Instance.new("SpecialMesh",RPart)
  348. sm.MeshType = "Cylinder"
  349. local ReinLineM = Weld(Main,RPart,CFrame.new(0,3,0))
  350.  
  351. BasePart.Name = "Part"
  352.  
  353. local Tail = NP()
  354. Tail.BrickColor = ManeColor
  355. Tail.CanCollide = false
  356. Tail.Transparency = 1
  357. Tail.Size = Vector3.new(0.8,4.5,0.8)
  358. 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))
  359. local TailWeld0 = TailWeld.C0
  360. local TailHairs = {}
  361. for i=1,8 do
  362. local t = NP()
  363. t.CanCollide = false
  364. t.BrickColor = Tail.BrickColor
  365. t.Size = Vector3.new(.4+aran()*.2,5.5-i*.1,.4+aran()*.2)
  366. 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))
  367. table.insert(TailHairs,{w=tw,c0=tw.C0})
  368. end
  369. local BackHairs = {}
  370. for i=0,10 do
  371. if i<1 or i>7 then
  372. local x = (i/10)
  373. local m = NP()
  374. m.CanCollide = false
  375. m.BrickColor = ManeColor
  376. m.Size = Vector3.new(.6+aran()*.2+math.sin(x*2.7)*.5,.9+ran()*.1,.9+ran()*.1)
  377. if i<1 then m.Size = m.Size*0.7 end
  378. 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))
  379. table.insert(BackHairs,{w=tw,c0=tw.C0})
  380. end
  381. end
  382.  
  383.  
  384. local NeckHairs = {}
  385. for i=0,6 do
  386. local x = (i/6)
  387. local m = NP()
  388. m.CanCollide = false
  389. m.BrickColor = ManeColor
  390. m.Size = Vector3.new(.8+ran()*.2,.7+ran()*.1,.9+ran()*.1)
  391. 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))
  392. table.insert(NeckHairs ,{w=tw,c0=tw.C0})
  393. end
  394.  
  395.  
  396. local HeadHairs = {}
  397. for i=0,6 do
  398. local x = math.min(1,(i/3))
  399. local m = NP()
  400. m.CanCollide = false
  401. m.BrickColor = ManeColor
  402. if HasHat then m.Transparency = 1 end
  403. m.Size = Vector3.new(.95+ran()*.2,1,.4)
  404. 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))
  405. table.insert(HeadHairs ,{w=tw,c0=tw.C0})
  406. end
  407.  
  408. local LHip = NP()
  409. LHip.Size = Vector3.new(1.5,3.7,3.5)
  410. Weld(Main,LHip,CFrame.new(-1,-.5,2.2)*CFrame.Angles(0,.35,0))
  411. Sphere(LHip)
  412.  
  413. local LThigh = NP()
  414. LThigh.CanCollide = false
  415. LThigh.Size = Vector3.new(1.6,4,2.2)
  416. 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))
  417. Sphere(LThigh)
  418.  
  419. local LBCannon = NP()
  420. LBCannon.CanCollide = false
  421. LBCannon.Size = Vector3.new(1,2.8,1)
  422. local sm = Instance.new("SpecialMesh",LBCannon)
  423. sm.MeshType = "Head"
  424. 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))
  425.  
  426. local LBKnee = NP()
  427. LBKnee.CanCollide = false
  428. LBKnee.Size = Vector3.new(1,1,1)
  429. local sm = Instance.new("SpecialMesh",LBKnee)
  430. sm.MeshType = "Sphere"
  431. Weld(LBCannon,LBKnee,CFrame.new(0,LBCannon.Size.Y/2-.1,0))
  432.  
  433. local LBHoof = NP()
  434. LBHoof.BrickColor = HoofColor
  435. LBHoof.CanCollide = false
  436. LBHoof.Size = Vector3.new(1,.7,1)
  437. Instance.new("CylinderMesh",LBHoof)
  438. local BL3 = Weld(LBCannon,LBHoof,CFrame.new(0,-LBCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  439.  
  440. local Hoof = NP()
  441. Hoof.BrickColor = HoofColor
  442. Hoof.CanCollide = false
  443. Hoof.Size = Vector3.new(.2,.699,.5)
  444. Weld(LBHoof,Hoof,CFrame.new(.4,0,.25))
  445. local Hoof = NP()
  446. Hoof.BrickColor = HoofColor
  447. Hoof.CanCollide = false
  448. Hoof.Size = Vector3.new(.2,.699,.5)
  449. Weld(LBHoof,Hoof,CFrame.new(-.4,0,.25))
  450.  
  451. local RHip = NP()
  452. RHip.Size = Vector3.new(1.5,3.7,3.5)
  453. Weld(Main,RHip,CFrame.new(1,-.5,2.2)*CFrame.Angles(0,-.35,0))
  454. Sphere(RHip)
  455.  
  456. local RThigh = NP()
  457. RThigh.CanCollide = false
  458. RThigh.Size = Vector3.new(1.6,4,2.2)
  459. 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))
  460. Sphere(RThigh)
  461.  
  462. local RBCannon = NP()
  463. RBCannon.CanCollide = false
  464. RBCannon.Size = Vector3.new(1,2.8,1)
  465. local sm = Instance.new("SpecialMesh",RBCannon)
  466. sm.MeshType = "Head"
  467. 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))
  468.  
  469. local RBKnee = NP()
  470. RBKnee.CanCollide = false
  471. RBKnee.Size = Vector3.new(1,1,1)
  472. local sm = Instance.new("SpecialMesh",RBKnee)
  473. sm.MeshType = "Sphere"
  474. Weld(RBCannon,RBKnee,CFrame.new(0,RBCannon.Size.Y/2-.1,0))
  475.  
  476. local RBHoof = NP()
  477. RBHoof.BrickColor = HoofColor
  478. RBHoof.CanCollide = false
  479. RBHoof.Size = Vector3.new(1,.7,1)
  480. Instance.new("CylinderMesh",RBHoof)
  481. local BR3 = Weld(RBCannon,RBHoof,CFrame.new(0,-RBCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  482.  
  483. local Hoof = NP()
  484. Hoof.BrickColor = HoofColor
  485. Hoof.CanCollide = false
  486. Hoof.Size = Vector3.new(.2,.699,.5)
  487. Weld(RBHoof,Hoof,CFrame.new(.4,0,.25))
  488. local Hoof = NP()
  489. Hoof.BrickColor = HoofColor
  490. Hoof.CanCollide = false
  491. Hoof.Size = Vector3.new(.2,.699,.5)
  492. Weld(RBHoof,Hoof,CFrame.new(-.4,0,.25))
  493.  
  494. local LShoulder = NP()
  495. LShoulder.Size = Vector3.new(1.5,2.5,2)
  496. Weld(Main,LShoulder,CFrame.new(-.9,-.5,-2.4)*CFrame.Angles(0,.15,0))
  497. Sphere(LShoulder)
  498.  
  499. local LForearm = NP()
  500. LForearm.CanCollide = false
  501. LForearm.Size = Vector3.new(1.2,3.5,1.5)
  502. local FL1 = Weld(LShoulder,LForearm,CFrame.new(-.1,.2,.1)*CFrame.Angles(0,0,0),CFrame.new(0,1.45,0))
  503. Sphere(LForearm)
  504.  
  505. local LFCannon = NP()
  506. LFCannon.CanCollide = false
  507. LFCannon.Size = Vector3.new(.8,2.8,.8)
  508. local sm = Instance.new("SpecialMesh",LFCannon)
  509. sm.MeshType = "Head"
  510. 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))
  511.  
  512. local LFKnee= NP()
  513. LFKnee.CanCollide = false
  514. LFKnee.Size = Vector3.new(.8,.8,.8)
  515. local sm = Instance.new("SpecialMesh",LFKnee)
  516. sm.MeshType = "Sphere"
  517. Weld(LFCannon,LFKnee,CFrame.new(0,LFCannon.Size.Y/2-.1,0))
  518.  
  519. local LFHoof = NP()
  520. LFHoof.BrickColor = HoofColor
  521. LFHoof.CanCollide = false
  522. LFHoof.Size = Vector3.new(.8,.6,.8)
  523. Instance.new("CylinderMesh",LFHoof)
  524. local FL3 = Weld(LFCannon,LFHoof,CFrame.new(0,-LFCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  525.  
  526. local Hoof = NP()
  527. Hoof.BrickColor = HoofColor
  528. Hoof.CanCollide = false
  529. Hoof.Size = Vector3.new(.2,.599,.4)
  530. Weld(LFHoof,Hoof,CFrame.new(.3,0,.2))
  531. local Hoof = NP()
  532. Hoof.BrickColor = HoofColor
  533. Hoof.CanCollide = false
  534. Hoof.Size = Vector3.new(.2,.599,.4)
  535. Weld(LFHoof,Hoof,CFrame.new(-.3,0,.2))
  536.  
  537. local RShoulder = NP()
  538. RShoulder.Size = Vector3.new(1.5,2.5,2)
  539. Weld(Main,RShoulder,CFrame.new(.9,-.5,-2.4)*CFrame.Angles(0,-.15,0))
  540. Sphere(RShoulder)
  541.  
  542. local RForearm = NP()
  543. RForearm.CanCollide = false
  544. RForearm.Size = Vector3.new(1.2,3.5,1.5)
  545. local FR1 = Weld(RShoulder,RForearm,CFrame.new(.1,.2,-.1)*CFrame.Angles(0,0,0),CFrame.new(0,1.45,0))
  546. Sphere(RForearm)
  547.  
  548. local RFCannon = NP()
  549. RFCannon.CanCollide = false
  550. RFCannon.Size = Vector3.new(.8,2.8,.8)
  551. local sm = Instance.new("SpecialMesh",RFCannon)
  552. sm.MeshType = "Head"
  553. 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))
  554.  
  555. local RFKnee= NP()
  556. RFKnee.CanCollide = false
  557. RFKnee.Size = Vector3.new(.8,.8,.8)
  558. local sm = Instance.new("SpecialMesh",RFKnee)
  559. sm.MeshType = "Sphere"
  560. Weld(RFCannon,RFKnee,CFrame.new(0,RFCannon.Size.Y/2-.1,0))
  561.  
  562. local RFHoof = NP()
  563. RFHoof.BrickColor = HoofColor
  564. RFHoof.CanCollide = false
  565. RFHoof.Size = Vector3.new(.8,.6,.8)
  566. Instance.new("CylinderMesh",RFHoof)
  567. local FR3 = Weld(RFCannon,RFHoof,CFrame.new(0,-RFCannon.Size.Y/2,0)*CFrame.Angles(0,0,0),CFrame.new(0,.12,.2))
  568.  
  569. local Hoof = NP()
  570. Hoof.BrickColor = HoofColor
  571. Hoof.CanCollide = false
  572. Hoof.Size = Vector3.new(.2,.599,.4)
  573. Weld(RFHoof,Hoof,CFrame.new(.3,0,.2))
  574. local Hoof = NP()
  575. Hoof.BrickColor = HoofColor
  576. Hoof.CanCollide = false
  577. Hoof.Size = Vector3.new(.2,.599,.4)
  578. Weld(RFHoof,Hoof,CFrame.new(-.3,0,.2))
  579.  
  580.  
  581.  
  582. Seat = Instance.new("VehicleSeat",Model)
  583. Seat.TopSurface,Seat.BottomSurface,Seat.LeftSurface,Seat.RightSurface,Seat.FrontSurface,Seat.BackSurface = 10,10,10,10,10,10
  584. Seat.Size = Vector3.new(2,1.2,.5)
  585. Seat.HeadsUpDisplay = false
  586. Seat.CanCollide = false
  587. Seat:BreakJoints()
  588. Seat.Transparency = 1
  589. Seat.CFrame = Main.CFrame
  590. SeatWeld = Weld(Main,Seat,CFrame.new(0,2.5,-.5),CFrame.new(0,0,0))
  591. local SeatWeld0 = SeatWeld.C0
  592.  
  593. Seat2 = Instance.new("Seat",Model)
  594. Seat2.TopSurface,Seat2.BottomSurface,Seat2.LeftSurface,Seat2.RightSurface,Seat2.FrontSurface,Seat2.BackSurface = 10,10,10,10,10,10
  595. Seat2.Size = Vector3.new(2,1.2,.5)
  596. Seat2.CanCollide = false
  597. Seat2.CFrame = Main.CFrame
  598. Seat2:BreakJoints()
  599. Seat2.Transparency = 1
  600. Weld(Seat2,Seat,CFrame.new(0,0,-1.8))
  601.  
  602. SaddleMain = NP()
  603. SaddleMain.Size = Vector3.new(2,1,3.5)
  604. SaddleMain.BrickColor = SaddleColor
  605. Sphere(SaddleMain)
  606. Weld(Seat,SaddleMain,CFrame.new(0,-0.5,0.6))
  607.  
  608. SaddleFront = NP()
  609. SaddleFront.Size = Vector3.new(1.6,1,0.3)
  610. SaddleFront.BrickColor = SaddleColor
  611. Sphere(SaddleFront)
  612. Weld(SaddleMain,SaddleFront,CFrame.new(0,0.4,-1.4)*CFrame.Angles(math.rad(-30),0,0))
  613.  
  614. SaddleBack = NP()
  615. SaddleBack.Size = Vector3.new(1.6,1,0.5)
  616. SaddleBack.BrickColor = SaddleColor
  617. Sphere(SaddleBack)
  618. Weld(SaddleMain,SaddleBack,CFrame.new(0,0.3,1.4)*CFrame.Angles(math.rad(30),0,0))
  619.  
  620. SaddleFlankR = NP()
  621. SaddleFlankR.Size = Vector3.new(0.3,1.7,1.8)
  622. SaddleFlankR.BrickColor = SaddleColor
  623. Sphere(SaddleFlankR)
  624. Weld(SaddleMain,SaddleFlankR,CFrame.new(1.5,-0.8,0),CFrame.new(0.1,-0.7,0)*CFrame.Angles(0,0,math.rad(-30)))
  625.  
  626. SaddleFlankL = NP()
  627. SaddleFlankL.Size = Vector3.new(0.3,1.7,1.8)
  628. SaddleFlankL.BrickColor = SaddleColor
  629. Sphere(SaddleFlankL)
  630. Weld(SaddleMain,SaddleFlankL,CFrame.new(-1.5,-0.8,0),CFrame.new(-0.1,-0.7,0)*CFrame.Angles(0,0,math.rad(30)))
  631.  
  632.  
  633.  
  634. local sWeld1,sWeld2;
  635.  
  636. Seat.DescendantAdded:connect(function(obj)
  637. if obj.Name == "SeatWeld" then
  638. sWeld1 = obj
  639. torso2 = obj.Part1.Parent.Torso
  640. local Torso = obj.Part1.Parent.Torso
  641. obj.C0 = obj.C0*CFrame.new(0,0,-1.5)
  642. local lhipr = Torso:FindFirstChild("Left Hip")
  643. local rhipr = Torso:FindFirstChild("Right Hip")
  644. if not lhipr or not rhipr then game:service'Debris':addItem(obj,.1) return end
  645. for i,v in pairs(Model:GetChildren()) do
  646. if v.Name == "Reins" and v:IsA("BasePart") then
  647. v.Transparency = Main.Transparency
  648. end
  649. end
  650. local lh0,lh1 = lhipr.Part0,lhipr.Part1
  651. local rh0,rh1 = rhipr.Part0,rhipr.Part1
  652. lhipr.Part0,lhipr.Part1 = nil,nil
  653. rhipr.Part0,rhipr.Part1 = nil,nil
  654. local lhip = lhipr:Clone()
  655. lhip.Name = "LH"
  656. lhip.Parent = lhipr.Parent
  657. lhip.Part0,lhip.Part1 = lh0,lh1
  658. local rhip = rhipr:Clone()
  659. rhip.Name = "RH"
  660. rhip.Parent = rhipr.Parent
  661. rhip.Part0,rhip.Part1 = rh0,rh1
  662. lhip.DesiredAngle = 0
  663. rhip.DesiredAngle = 0
  664. local lhip0,lhip1,rhip0,rhip1 = lhip.C0,lhip.C1,rhip.C0,rhip.C1
  665. lhip.C0 = lhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(-40))
  666. lhip.C1 = lhip1*CFrame.new(0.1,-0.2,0)
  667. rhip.C0 = rhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(40))
  668. rhip.C1 = rhip1*CFrame.new(-0.1,-0.2,0)
  669. local toolOn = false
  670. local toolAn = 0
  671. local toolCon;
  672. local toolChan;
  673. local oc0 = obj.C0
  674. local newChild = function(d)
  675. local md = d:FindFirstChild("MouseDown")
  676. if d:IsA("Tool") and md and md:IsA("BoolValue") then
  677. pcall(function() toolChan:disconnect() end)
  678. toolOn = false
  679. toolChan = md.Changed:connect(function()
  680. toolOn = md.Value
  681. if not toolOn then return end
  682. pcall(function() ReinsHold = CFrame.new(0,2,-1.7) end)
  683. while toolOn and game:service'RunService'.Stepped:wait() do
  684. toolAn = math.min(1,toolAn+.2)
  685. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  686. end
  687. while not toolOn and game:service'RunService'.Stepped:wait() do
  688. toolAn = math.max(0,toolAn-.2)
  689. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  690. if toolAn == 0 then break end
  691. end
  692. ReinsHold = nil
  693. end)
  694. end
  695. end
  696. local ctrlgui;
  697. if Torso.Parent then
  698. toolCon = Torso.Parent.ChildAdded:connect(newChild)
  699. for i,v in pairs(Torso.Parent:GetChildren()) do
  700. newChild(v)
  701. end
  702. local plr = game.Players:GetPlayerFromCharacter(Torso.Parent)
  703. if plr then
  704. ctrlgui = Instance.new("ScreenGui")
  705. local fr = Instance.new("Frame",ctrlgui)
  706. fr.Position = UDim2.new(1,0,.9,0)
  707. fr.Size = UDim2.new(-.07,0,.02,0)
  708. fr.BackgroundTransparency = 1
  709. local function nbtn(text,indent)
  710. for i,v in pairs(fr:GetChildren()) do
  711. v.Position = v.Position - UDim2.new(0,0,1,1)
  712. end
  713. local tb = Instance.new("TextButton",fr)
  714. tb.Size = UDim2.new(-1,4+(indent-1)*3,1,-4)
  715. tb.Position = UDim2.new(1,2,0,2)
  716. tb.BorderSizePixel = 3
  717. tb.BackgroundColor3 = HorseColor.Color
  718. tb.BorderColor3 = ManeColor.Color
  719. tb.Text = " "..text.." "
  720. tb.TextXAlignment = "Left"
  721. tb.TextColor3 = Color3.new(1,1,1)
  722. tb.TextStrokeTransparency = .6
  723. tb.TextScaled = true
  724. tb.ZIndex = 10
  725. local il = Instance.new("ImageLabel",tb)
  726. il.Size = UDim2.new(-1,2,1,-2)
  727. il.Image = "rbxassetid://129465985"
  728. il.SizeConstraint = "RelativeYY"
  729. il.BackgroundTransparency = 1
  730. il.Position = UDim2.new(1,0,0,2)
  731. il.ZIndex = 10
  732. return tb
  733. end
  734. nbtn("| Horse menu",1).AutoButtonColor = false
  735. nbtn("- Max speed",2).AutoButtonColor = false
  736. local gal = nbtn("~ Gallop",3)
  737. local trot = nbtn("~ Trot",3)
  738. local walk = nbtn("~ Walk",3)
  739. local tar = (SpeedLimit == MaxSpeed and gal or SpeedLimit == TrotSpeed and trot or walk)
  740. tar.BackgroundColor3 = Color3.new(0,.7,0)
  741. gal.MouseButton1Down:connect(function()
  742. gal.BackgroundColor3 = Color3.new(0,.7,0)
  743. trot.BackgroundColor3 = HorseColor.Color
  744. walk.BackgroundColor3 = HorseColor.Color
  745. SpeedLimit = MaxSpeed
  746. end)
  747. trot.MouseButton1Down:connect(function()
  748. gal.BackgroundColor3 = HorseColor.Color
  749. trot.BackgroundColor3 = Color3.new(0,.7,0)
  750. walk.BackgroundColor3 = HorseColor.Color
  751. SpeedLimit = TrotSpeed
  752. end)
  753. walk.MouseButton1Down:connect(function()
  754. gal.BackgroundColor3 = HorseColor.Color
  755. trot.BackgroundColor3 = HorseColor.Color
  756. walk.BackgroundColor3 = Color3.new(0,.7,0)
  757. SpeedLimit = WalkSpeed
  758. end)
  759. pcall(function()
  760. for i,v in pairs(plr:GetChildren()) do
  761. pcall(function()
  762. if v:IsA("PlayerGui") then
  763. ctrlgui.Parent = v
  764. end
  765. end)
  766. end
  767. end)
  768. end
  769. end
  770.  
  771. obj.AncestryChanged:connect(function(c,p)
  772. if c ~= obj or p == Seat then return end
  773. lhip:Destroy()
  774. rhip:Destroy()
  775. lhipr.Part0,lhipr.Part1 = lh0,lh1
  776. rhipr.Part0,rhipr.Part1 = rh0,rh1
  777. obj:Destroy()
  778. ReinsHold = nil
  779. for i,v in pairs(Model:GetChildren()) do
  780. if v.Name == "Reins" and v:IsA("BasePart") then
  781. v.Transparency = 1
  782. end
  783. end
  784. pcall(function() toolCon:disconnect() end)
  785. pcall(function() toolChan:disconnect() end)
  786. pcall(game.Destroy,ctrlgui)
  787. end)
  788. end
  789. end)
  790.  
  791. Seat2.DescendantAdded:connect(function(obj)
  792. if obj.Name == "SeatWeld" then
  793. sWeld2 = obj
  794. local Torso = obj.Part1.Parent.Torso
  795. obj.C0 = obj.C0*CFrame.new(0,.5,-1.5)
  796. local lhipr = Torso:FindFirstChild("Left Hip")
  797. local rhipr = Torso:FindFirstChild("Right Hip")
  798. if not lhipr or not rhipr then game:service'Debris':addItem(obj,.1) return end
  799. local lh0,lh1 = lhipr.Part0,lhipr.Part1
  800. local rh0,rh1 = rhipr.Part0,rhipr.Part1
  801. lhipr.Part0,lhipr.Part1 = nil,nil
  802. rhipr.Part0,rhipr.Part1 = nil,nil
  803. local lhip = lhipr:Clone()
  804. lhip.Name = "LH"
  805. lhip.Parent = lhipr.Parent
  806. lhip.Part0,lhip.Part1 = lh0,lh1
  807. local rhip = rhipr:Clone()
  808. rhip.Name = "RH"
  809. rhip.Parent = rhipr.Parent
  810. rhip.Part0,rhip.Part1 = rh0,rh1
  811. lhip.DesiredAngle = 0
  812. rhip.DesiredAngle = 0
  813. local lhip0,lhip1,rhip0,rhip1 = lhip.C0,lhip.C1,rhip.C0,rhip.C1
  814. lhip.C0 = lhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(-40))
  815. lhip.C1 = lhip1*CFrame.new(0.1,-0.2,0)
  816. rhip.C0 = rhip0*CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(-45),0,math.rad(40))
  817. rhip.C1 = rhip1*CFrame.new(-0.1,-0.2,0)
  818. local toolOn = false
  819. local toolAn = 0
  820. local toolCon;
  821. local toolChan;
  822. local oc0 = obj.C0
  823. local newChild = function(d)
  824. local md = d:FindFirstChild("MouseDown")
  825. if d:IsA("Tool") and md and md:IsA("BoolValue") then
  826. pcall(function() toolChan:disconnect() end)
  827. toolOn = false
  828. toolChan = md.Changed:connect(function()
  829. toolOn = md.Value
  830. if not toolOn then return end
  831. while toolOn and game:service'RunService'.Stepped:wait() do
  832. toolAn = math.min(1,toolAn+.2)
  833. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  834. end
  835. while not toolOn and game:service'RunService'.Stepped:wait() do
  836. toolAn = math.max(0,toolAn-.2)
  837. obj.C0 = CFrame.new(toolAn*1.8,toolAn*-1.1,0)*CFrame.Angles(0,0,-toolAn*.9)*oc0
  838. if toolAn == 0 then break end
  839. end
  840. end)
  841. end
  842. end
  843. toolCon = Torso.Parent.ChildAdded:connect(newChild)
  844. for i,v in pairs(Torso.Parent:GetChildren()) do
  845. newChild(v)
  846. end
  847. obj.AncestryChanged:connect(function(c,p)
  848. if c ~= obj or p == Seat2 then return end
  849. lhip:Destroy()
  850. rhip:Destroy()
  851. lhipr.Part0,lhipr.Part1 = lh0,lh1
  852. rhipr.Part0,rhipr.Part1 = rh0,rh1
  853. obj:Destroy()
  854. end)
  855. end
  856. end)
  857.  
  858. for i,v in pairs(Model:GetChildren()) do
  859. if v.Name == "Reins" and v:IsA("BasePart") then
  860. v.Transparency = 1
  861. end
  862. end
  863.  
  864. local Filler = NP()
  865. Filler.Size = Vector3.new(3,4,7)
  866. Filler.Transparency = 1
  867. Weld(Main,Filler,CFrame.new(0,-2,0))
  868.  
  869. local BallB = NP()
  870. BallB.CanCollide = true
  871. BallB.Shape = "Ball"
  872. BallB.Size = Vector3.new(3,3,3)
  873. BallB.Transparency = 1
  874. local BBW = Weld(Main,BallB,CFrame.new(0,-Height+BallB.Size.Y/2,3))
  875. BBW0 = BBW.C0
  876.  
  877. local BallF = NP()
  878. BallF.CanCollide = true
  879. BallF.Shape = "Ball"
  880. BallF.Size = Vector3.new(3,3,3)
  881. BallF.Transparency = 1
  882. local FBW = Weld(Main,BallF,CFrame.new(0,-Height+BallB.Size.Y/2,-3))
  883. FBW0 = FBW.C0
  884.  
  885. local BG = Instance.new("BodyGyro",Main)
  886. BG.cframe = Main.CFrame
  887. local bgcf = BG.cframe
  888. BG.maxTorque = Vector3.new(1,1,1)*4e6
  889.  
  890. local BF = Instance.new("BodyForce",Main)
  891. BF.force = Vector3.new(0,10000,0)
  892.  
  893. local BV = Instance.new("BodyVelocity",Main)
  894. BV.maxForce = Vector3.new(1,1,1)*4e6
  895. BV.velocity = Vector3.new()
  896. local bvvel = Vector3.new()
  897.  
  898. local Legs = {
  899. FR1,FR2,FR3,
  900. FL1,FL2,FL3,
  901. BR1,BR2,BR3,
  902. BL1,BL2,BL3,
  903. }
  904. local Legs0 = {}
  905. for i,v in pairs(Legs) do
  906. Legs0[i] = v.C0
  907. end
  908.  
  909. function RayCast(Ray,Ignore)
  910. local hit,p = workspace:FindPartOnRayWithIgnoreList(Ray,Ignore)
  911. if not hit or hit.CanCollide then
  912. return hit,p
  913. elseif hit then
  914. table.insert(Ignore,hit)
  915. return RayCast(Ray,Ignore)
  916. end
  917. end
  918.  
  919.  
  920. --Model:MoveTo(startpos.p)
  921.  
  922. local climbangle = 0
  923. local blinktimer = 0
  924.  
  925. --while game:GetService("RunService").Stepped:wait() do
  926. local connection
  927. connection = game:GetService("RunService").Stepped:connect(oc(function()
  928. if not Model:IsDescendantOf(workspace) then
  929. pcall(game.Destroy,Model)
  930. pcall(game.Destroy,script)
  931. connection:disconnect()
  932. end
  933. local th = Seat.Throttle
  934. local st = Seat.Steer
  935. local TailSin = math.sin(tick()*(th==1 and .5+Speed/MaxSpeed*6 or 2))
  936. local BreathSin = math.sin(tick()*(th==1 and (Speed<=WalkSpeed and WalkSin/2 or Speed<=TrotSpeed and TrotSin/2 or GallopSin/2) or 2))
  937. 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)
  938.  
  939. local d,un = 10;
  940. if th == 0 and st == 0 then
  941. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  942. pcall(function()
  943. local dis = v:DistanceFromCharacter(Head.Position)
  944. if dis < d then
  945. local u = Main.CFrame:vectorToObjectSpace((v.Character.Head.Position-Head.Position).unit)
  946. if u.Z < 0 then
  947. d,un = dis,u
  948. end
  949. end
  950. end)
  951. end
  952. end
  953.  
  954. if math.random(1,150) == 1 then
  955. blinktimer = 4
  956. end
  957. if blinktimer > 0 then
  958. EyeR.BrickColor = HorseColor
  959. EyeL.BrickColor = HorseColor
  960. blinktimer = blinktimer - 1
  961. else
  962. EyeR.BrickColor = EyeColor
  963. EyeL.BrickColor = EyeColor
  964. end
  965. 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)
  966. 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)
  967. MainMesh.Scale = Vector3.new(1,1+(BreathSin*.025),1)
  968. SeatWeld.C0 = SeatWeld0 + Vector3.new(0,BreathSin*.05,0)
  969. bgcf = bgcf * CFrame.Angles(0,-st*.05,0)
  970. 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))
  971. 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)))
  972. updown = th==1 and Speed > TrotSpeed and math.abs(math.sin((tick()-.1)*3)) or math.max(0,(updown or 0)-.1)
  973.  
  974. local front = Main.CFrame*CFrame.new(0,0,-3)
  975. local back = Main.CFrame*CFrame.new(0,0,3)
  976.  
  977.  
  978. local fHit,fP = RayCast(Ray.new(front.p,front:vectorToWorldSpace(Vector3.new(0,-Height*6,0))),{Model})
  979.  
  980. local fDiff = (front.p-fP).magnitude
  981. if fDiff > Height*2 then
  982. fHit = nil
  983. end
  984. local fY = math.max(fP.Y,front.Y-Height)
  985.  
  986. local bHit,bP = RayCast(Ray.new(back.p,back:vectorToWorldSpace(Vector3.new(0,-Height*6,0))),{Model})
  987. local bDiff = (back.p-bP).magnitude
  988. if bDiff > Height*2 then
  989. bHit = nil
  990. end
  991. local bY = math.max(bP.Y,back.Y-Height)
  992.  
  993. local diffY = (fY+bY)/2-(Main.Position.Y-Height)
  994.  
  995. climbangle = fHit and bHit and math.asin((fP-bP).unit.Y) or climbangle*.5
  996.  
  997. bvvel = Main.CFrame.lookVector.unit * Speed
  998. BV.velocity = (fP-bP).unit*Speed + Vector3.new(0,-(math.min(fDiff-Height,bDiff-Height)+updown*.8)*3,0)
  999. BV.maxForce = Vector3.new(1,1,1)*4e6
  1000. BBW.C0 = BBW0 + Vector3.new(0,updown*.8,-1.4)
  1001. FBW.C0 = FBW0 + Vector3.new(0,updown*.8,1.4)
  1002.  
  1003. for i=1,#Legs,3 do
  1004. local ang = 0;
  1005. local ang2 = 0;
  1006. local ang3 = 0;
  1007. local time = tick()
  1008. if i < #Legs/2 then -- front
  1009. if i%6 == 1 then -- Right
  1010. if th == 1 then
  1011. if Speed <= WalkSpeed then -- walky
  1012. ang = math.sin(time*WalkSin)*.15 + .05
  1013. ang2 = -math.abs(math.cos(time*WalkSin/2))*.4
  1014. elseif Speed <= TrotSpeed then
  1015. ang = math.sin(time*TrotSin)*.5 + .4
  1016. ang2 = -math.abs(math.cos(time*TrotSin/2))*1.7
  1017. else
  1018. ang = math.sin(time*6)*.8 + .35
  1019. ang2 = -math.abs(math.cos(time*3))*1.8
  1020. end
  1021. elseif th == -1 then
  1022. ang = math.sin(time*6)*.3 +.25
  1023. time = time -.1
  1024. ang2 = -math.abs(math.sin(time*3))*1.3 +.2
  1025. else
  1026. ang = math.sin(tick()*2)*.5 + .5
  1027. ang2 = -math.abs(math.cos(tick()*1) )*1.5
  1028. ang3 = ang2
  1029. end
  1030. else -- left
  1031. if th == 1 then
  1032. if Speed <= WalkSpeed then -- walky
  1033. time = time + math.pi/WalkSin
  1034. ang = math.sin(time*WalkSin)*.15 + .05
  1035. ang2 = -math.abs(math.cos(time*WalkSin/2))*.4
  1036. elseif Speed <= TrotSpeed then
  1037. time = time + math.pi/TrotSin
  1038. ang = math.sin(time*TrotSin)*.5 + .4
  1039. ang2 = -math.abs(math.cos(time*TrotSin/2))*1.7
  1040. else
  1041. time = time + .15
  1042. ang = math.sin(time*6)*.8 + .35
  1043. ang2 = -math.abs(math.cos(time*3))*1.8
  1044. end
  1045. elseif th == -1 then
  1046. time = time + math.pi/2
  1047. ang = math.sin(time*6)*.3 +.25
  1048. time = time -.1
  1049. ang2 = -math.abs(math.sin(time*3))*1.3 +.2
  1050. else
  1051. end
  1052. end
  1053. else -- back
  1054. if i%6 == 1 then -- Right
  1055. if th == 1 then
  1056. if Speed <= WalkSpeed then -- walky
  1057. ang = math.sin(time*WalkSin)*.1 - .6
  1058. ang2 = math.abs(math.cos(time*WalkSin/2))*.5 + .4
  1059. elseif Speed <= TrotSpeed then
  1060. ang = math.sin(time*TrotSin)*.5 - .8
  1061. ang2 = math.abs(math.cos(time*TrotSin/2))*1.4 - .1
  1062. ang3 = ang2-1
  1063. else
  1064. time = time + math.pi/2
  1065. ang = math.sin(time*6)*.5 - .8
  1066. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  1067. ang3 = ang2-1
  1068. end
  1069. elseif th == -1 then
  1070. ang = math.sin(time*6)*.2 - .6
  1071. time = time -.5
  1072. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  1073. ang3 = math.sin(time*6)*.2
  1074. else
  1075. ang = -.5
  1076. ang2 = .65
  1077. ang3 = -.15
  1078. end
  1079. else -- left
  1080. if th == 1 then
  1081. if Speed <= WalkSpeed then -- walky
  1082. time = time + math.pi/WalkSin
  1083. ang = math.sin(time*WalkSin)*.1 - .7
  1084. ang2 = math.abs(math.cos(time*WalkSin/2))*.5 + .4
  1085. elseif Speed <= TrotSpeed then
  1086. time = time - math.pi/TrotSin
  1087. ang = math.sin(time*TrotSin)*.5 - .8
  1088. ang2 = math.abs(math.cos(time*TrotSin/2))*1.4 - .1
  1089. ang3 = ang2-1
  1090. else
  1091. time = time + math.pi/2 - .15
  1092. ang = math.sin(time*6)*.5 - .8
  1093. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  1094. ang3 = ang2-1
  1095. end
  1096. elseif th == -1 then
  1097. time = time + math.pi/2
  1098. ang = math.sin(time*6)*.2 - .6
  1099. time = time -.5
  1100. ang2 = math.abs(math.cos(time*3))*1.4 - .1
  1101. ang3 = math.sin(time*6)*.2
  1102. else
  1103. ang = -.55
  1104. ang2 = .65
  1105. ang3 = -.1
  1106. end
  1107. end
  1108. end
  1109. Legs[i].C0 = clerp(Legs[i].C0,Legs0[i] * CFrame.Angles(ang,0,0), .2)
  1110. Legs[i+1].C0 =clerp(Legs[i+1].C0, Legs0[i+1] * CFrame.Angles(ang2,0,0), .2)
  1111. Legs[i+2].C0 = clerp(Legs[i+2].C0, Legs0[i+2] * CFrame.Angles(ang3,0,0), .2)
  1112. end
  1113.  
  1114. -- Reins
  1115. if ReinLineM and ReinLineM.Part1 and ReinLineM.Part1.Transparency < 1 then
  1116. local rHold = ReinsHold or CFrame.new(0,3.5,-2)
  1117. ReinSphereL.C0 = rHold*CFrame.new(-1.8,0,0) + Vector3.new(0,BreathSin*.05,0)
  1118. ReinSphereR.C0 = rHold*CFrame.new(1.8,0,0) + Vector3.new(0,BreathSin*.05,0)
  1119. local lp1 = Main.CFrame:pointToObjectSpace(ReinAnchorL.Position) + Vector3.new(-0.05,0,0)
  1120. local lp2 = ReinSphereL.C0.p
  1121. ReinLineL.C0 = CFrame.new(lp1:Lerp(lp2,.5),lp2)*CFrame.Angles(0,math.pi/2,0)
  1122. ReinLineL.Part1.Mesh.Scale = Vector3.new((lp2-lp1).magnitude/ReinLineL.Part1.Size.X,1,1)
  1123. local rp1 = Main.CFrame:pointToObjectSpace(ReinAnchorR.Position) + Vector3.new(0.05,0,0)
  1124. local rp2 = ReinSphereR.C0.p
  1125. ReinLineR.C0 = CFrame.new(rp1:Lerp(rp2,.5),rp2)*CFrame.Angles(0,math.pi/2,0)
  1126. ReinLineR.Part1.Mesh.Scale = Vector3.new((rp2-rp1).magnitude/ReinLineR.Part1.Size.X,1,1)
  1127. ReinLineM.C0 = CFrame.new(lp2:Lerp(rp2,.5),rp2)*CFrame.Angles(0,math.pi/2,0)
  1128. ReinLineM.Part1.Mesh.Scale = Vector3.new((rp2-lp2).magnitude/ReinLineM.Part1.Size.X,1,1)
  1129. end
  1130. for i,v in pairs(BackHairs) do
  1131. 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)
  1132. end
  1133. --[[
  1134. for i,v in pairs(TailHairs) do
  1135. v.w.C0 = v.c0 * CFrame.Angles(math.sin(TailSin+i)*.05,math.sin(TailSin+i^2)*.05,math.sin(TailSin+i^3)*.05)
  1136. end
  1137. for i,v in pairs(NeckHairs) do
  1138. v.w.C0 = v.c0 * CFrame.Angles(math.sin(BreathSin+i)*.05,math.sin(BreathSin+i^2)*.05,math.sin(BreathSin+i^3)*.05)
  1139. end
  1140. for i,v in pairs(HeadHairs) do
  1141. v.w.C0 = v.c0 * CFrame.Angles(math.sin(BreathSin+i)*.08,math.sin(BreathSin+i^2)*.08,math.sin(BreathSin+i^3)*.08)
  1142. end]]
  1143. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement