Advertisement
jayrock3401

Untitled

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