Advertisement
NextFlamePB

ROBLOX Anti's Horse Script

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