Model=script.Parent local t local N sound=false Players=game:GetService("\080\108\097\121\101\114\115")Debris=game:GetService("\068\101\098\114\105\115")RunService=game:GetService("\082\117\110\083\101\114\118\105\099\101")Humanoid=Model:WaitForChild("\072\117\109\097\110\111\105\100")Humanoid.Health=Humanoid.MaxHealth Seat=Model:WaitForChild("\083\101\097\116")Torso=Model:WaitForChild("\084\111\114\115\111")InteractiveControl=script:WaitForChild("\073\110\116\101\114\097\099\116\105\118\101\067\111\110\116\114\111\108")Animations={Walk={Animation=script:WaitForChild("\087\097\108\107"),FadeTime=nil;Weight=nil,Speed=.5};Idle={Animation=script:WaitForChild("\073\100\108\101");FadeTime=nil,Weight=nil;Speed=1};Ride={Animation=script:WaitForChild("\082\105\100\101");FadeTime=.25;Weight=nil,Speed=nil},Rear={Animation=script:WaitForChild("\082\101\097\114\105\110\103"),FadeTime=.25,Weight=nil;Speed=2},Jump={Animation=script:WaitForChild("\074\117\109\112"),FadeTime=nil,Weight=nil;Speed=1}}Walking=false Rider=nil AngularVelocity=Torso:FindFirstChild("\066\111\100\121\065\110\103\117\108\097\114\086\101\108\111\099\105\116\121")or Instance.new("\066\111\100\121\065\110\103\117\108\097\114\086\101\108\111\099\105\116\121")AngularVelocity.Name="\066\111\100\121\065\110\103\117\108\097\114\086\101\108\111\099\105\116\121"AngularVelocity.P=1250 AngularVelocity.AngularVelocity=Vector3.new(0,0,0)AngularVelocity.maxTorque=Vector3.new(0,math.huge,0)AngularVelocity.Parent=Torso Velocity=Torso:FindFirstChild("\066\111\100\121\086\101\108\111\099\105\116\121")or Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121")Velocity.Name="\066\111\100\121\086\101\108\111\099\105\116\121"Velocity.maxForce=Vector3.new(math.huge,0,math.huge)Velocity.Parent=Torso WalkTrack=Humanoid:LoadAnimation(Animations.Walk.Animation)IdleTrack=Humanoid:LoadAnimation(Animations.Idle.Animation)RearTrack=Humanoid:LoadAnimation(Animations.Rear.Animation)JumpTrack=Humanoid:LoadAnimation(Animations.Jump.Animation)Remotes=script:WaitForChild("\082\101\109\111\116\101\115")Remotes:ClearAllChildren()LastJump=0 Disabled=false ServerControl=Remotes:FindFirstChild("\083\101\114\118\101\114\067\111\110\116\114\111\108")or Instance.new("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")ServerControl.Name="\083\101\114\118\101\114\067\111\110\116\114\111\108"ServerControl.Parent=Remotes ClientControl=Remotes:FindFirstChild("\067\108\105\101\110\116\067\111\110\116\114\111\108")or Instance.new("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")ClientControl.Name="\067\108\105\101\110\116\067\111\110\116\114\111\108"ClientControl.Parent=Remotes function OnServerInvoke(t,N,M)if t~=Rider or not N then return end if N=="\074\117\109\112"then local t=tick()if t-LastJump>=1 then LastJump=t Humanoid.Jump=true local N=Animations.Jump JumpTrack:Play(N.FadeTime,N.Weight,N.Speed)end elseif N=="\068\105\115\109\111\117\110\116"then Dismount()end end ServerControl.OnServerInvoke=OnServerInvoke Humanoid.Changed:connect(function(t)if t=="\083\105\116"and Humanoid.Sit then Humanoid.Sit=false end end)Humanoid.Died:connect(function()Disabled=true Debris:AddItem(Model,3)Model:BreakJoints()end)function InvokeClient(t,N)local M=nil pcall(function()M=ClientControl:InvokeClient(Rider,t,N)end)return M end function Audio(t,N,M,p,L)local f=Instance.new("\083\111\117\110\100",N)f.SoundId="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061"..t f.Volume=p f.Looped=M if L then(game:GetService("\068\101\098\114\105\115")):AddItem(f,L)end return f end function Animate(M)if Humanoid.Health==0 or Disabled then return end if not Walking and Torso.Velocity.magnitude>1 then IdleTrack:Stop()local t=Animations.Walk WalkTrack:Play(t.FadeTime,t.Weight,t.Speed)Walking=true end if Walking and Torso.Velocity.magnitude<1 then WalkTrack:Stop()local t=Animations.Idle IdleTrack:Play(t.FadeTime,t.Weight,t.Speed)Walking=false end if Seat.Throttle~=10 then Velocity.velocity=((Torso.CFrame.lookVector*Seat.Throttle)*Humanoid.WalkSpeed)*1 AngularVelocity.AngularVelocity=Vector3.new(3,2*-Seat.Steer,0)else Velocity.velocity=Vector3.new(0,0,0)N=Audio(178645076,Torso,false,3)if sound==false then sound=true local t=Animations.Rear RearTrack:Play(t.FadeTime,t.Weight,t.Speed)N:Play()N.Volume=10 N.Pitch=1 wait(2)sound=false end end if not t then t=Audio(134973578,Torso,true,0)elseif Torso.Velocity.magnitude>1 then if not t.IsPlaying then t:Play()end t.Volume=10 t.Pitch=.65*(Torso.Velocity.Magnitude/script.Parent.MaxSpeed.Value)+.55 else t:Stop()end if JumpTrack.IsPlaying then t:Stop()end end function Dismount()if Rider and Rider.Parent then local t=Rider.Character if t then local N=nil for t,M in pairs(t:GetChildren())do if M:IsA("\072\117\109\097\110\111\105\100")then N=M break end end N:ChangeState(Enum.HumanoidStateType.Jumping)N.Jump=true end end end function PlayerSeated(t)local function N()Debris:AddItem(t,.5)if t and t.Parent then t:Destroy()end end if not t:IsA("\087\101\108\100")or not t.Name=="\083\101\097\116\087\101\108\100"then return end if t.Part0~=Seat or not t.Part1 or not t.Part1.Parent then return end t.C1=t.C1*CFrame.new(0,.5,.375)local M=t.Part1.Parent local p=M:FindFirstChild("\072\117\109\097\110\111\105\100")if p then local t=Animations.Ride RideTrack=p:LoadAnimation(t.Animation)RideTrack:Play(t.FadeTime,t.Weight,t.Speed)end local L=Players:GetPlayerFromCharacter(M)if not L then N()return end local f=L:FindFirstChild("\080\108\097\121\101\114\071\117\105")if not f then N()return end InteractiveControlCopy=InteractiveControl:Clone()local I=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")I.Name="\083\101\114\118\101\114\067\111\110\116\114\111\108"I.Value=ServerControl I.Parent=InteractiveControlCopy InteractiveControlCopy.Disabled=false InteractiveControlCopy.Parent=f Rider=L end function PlayerDismounted(t)if not t:IsA("\087\101\108\100")or not t.Name=="\083\101\097\116\087\101\108\100"then return end if not t.Part1 or not t.Part1.Parent then return end local N=Players:GetPlayerFromCharacter(t.Part1.Parent)if not N or N~=Rider then return end if InteractiveControlCopy and InteractiveControlCopy.Parent then InteractiveControlCopy:Destroy()end if RideTrack then RideTrack:Stop()end Rider=nil end RunService.Heartbeat:connect(Animate)Seat.ChildAdded:connect(PlayerSeated)Seat.ChildRemoved:connect(PlayerDismounted)
--Original script by Luckymaxer

Model = script.Parent
local SoundLoop
local Whinny
sound = false
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")

Humanoid = Model:WaitForChild("Humanoid")
Humanoid.Health = Humanoid.MaxHealth
Seat = Model:WaitForChild("Seat")
Torso = Model:WaitForChild("Torso")

InteractiveControl = script:WaitForChild("InteractiveControl")

Animations = {
	Walk = { Animation = script:WaitForChild("Walk"), FadeTime = nil, Weight = nil, Speed = 0.5 },
	Idle = { Animation = script:WaitForChild("Idle"), FadeTime = nil, Weight = nil, Speed = 1 },
	Ride = { Animation = script:WaitForChild("Ride"), FadeTime = 0.25, Weight = nil, Speed = nil },
	Rear = { Animation = script:WaitForChild("Rearing"), FadeTime = 0.25, Weight = nil, Speed = 2 },
	Jump = { Animation = script:WaitForChild("Jump"), FadeTime = nil, Weight = nil, Speed = 1 },
}

Walking = false
Rider = nil

AngularVelocity = (Torso:FindFirstChild("BodyAngularVelocity") or Instance.new("BodyAngularVelocity"))
AngularVelocity.Name = "BodyAngularVelocity"
AngularVelocity.P = 1250
AngularVelocity.AngularVelocity = Vector3.new(0, 0, 0)
AngularVelocity.maxTorque = Vector3.new(0, math.huge, 0)
AngularVelocity.Parent = Torso

Velocity = (Torso:FindFirstChild("BodyVelocity") or Instance.new("BodyVelocity"))
Velocity.Name = "BodyVelocity"
Velocity.maxForce = Vector3.new(math.huge, 0, math.huge)
Velocity.Parent = Torso

WalkTrack = Humanoid:LoadAnimation(Animations.Walk.Animation)
IdleTrack = Humanoid:LoadAnimation(Animations.Idle.Animation)
RearTrack = Humanoid:LoadAnimation(Animations.Rear.Animation)
JumpTrack = Humanoid:LoadAnimation(Animations.Jump.Animation)

Remotes = script:WaitForChild("Remotes")
Remotes:ClearAllChildren()

LastJump = 0
Disabled = false

ServerControl = (Remotes:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Remotes

ClientControl = (Remotes:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Remotes

function OnServerInvoke(player, Mode, Value)
	if player ~= Rider or not Mode then
		return
	end
	if Mode == "Jump" then
		local Now = tick()
		if (Now - LastJump) >= 1 then
			LastJump = Now
			Humanoid.Jump = true
			local Animation = Animations.Jump
			JumpTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
		end
	elseif Mode == "Dismount" then
		Dismount()
	end
end

ServerControl.OnServerInvoke = OnServerInvoke

Humanoid.Changed:connect(function(Property)
	if Property == "Sit" and Humanoid.Sit then
		Humanoid.Sit = false
	end
end)

Humanoid.Died:connect(function()
	Disabled = true
	Debris:AddItem(Model, 3)
	Model:BreakJoints()
end)

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Rider, Mode, Value)
	end)
	return ClientReturn
end

function Audio(ID, Location, Looped, Volume, Duration)
	local Sound = Instance.new("Sound", Location)
	Sound.SoundId = "http://www.roblox.com/asset/?id=" .. ID
	Sound.Volume = Volume
	Sound.Looped = Looped
	if Duration then
		game:GetService("Debris"):AddItem(Sound, Duration)
	end
	return Sound -- use as Audio(134973578, FrontTorso, true, 2)
end

function Animate(Time)
	if Humanoid.Health == 0 or Disabled then
		return
	end
	--Walking
	if not Walking and Torso.Velocity.magnitude > 1 then
		IdleTrack:Stop()
		local Animation = Animations.Walk
		WalkTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
		Walking = true
	end
	if Walking and Torso.Velocity.magnitude < 1 then
		WalkTrack:Stop()
		local Animation = Animations.Idle
		IdleTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
		Walking = false
	end
	--Motion
	if Seat.Throttle ~= 10 then
		Velocity.velocity = (Torso.CFrame.lookVector * Seat.Throttle * Humanoid.WalkSpeed * 1)
		AngularVelocity.AngularVelocity = Vector3.new(3, (2 * -Seat.Steer), 0) --steer speed
	else
		Velocity.velocity = Vector3.new(0, 0, 0) --Erase for moonwalk
		Whinny = Audio(178645076, Torso, false, 3)
		if sound == false then
			sound = true
			local Animation = Animations.Rear
			RearTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
			Whinny:Play()
			Whinny.Volume = 10
			Whinny.Pitch = 1
			wait(2)
			sound = false
		end
	end

	--Sound
	if not SoundLoop then
		SoundLoop = Audio(134973578, Torso, true, 0)
	elseif Torso.Velocity.magnitude > 1 then
		if not SoundLoop.IsPlaying then
			SoundLoop:Play()
		end
		SoundLoop.Volume = 10
		SoundLoop.Pitch = ((1.2 - 0.55) * (Torso.Velocity.Magnitude / script.Parent.MaxSpeed.Value)) + 0.55
	else
		SoundLoop:Stop()
	end
	if JumpTrack.IsPlaying then
		SoundLoop:Stop()
	end
end

function Dismount()
	if Rider and Rider.Parent then
		local Character = Rider.Character
		if Character then
			local Humanoid = nil
			for i, v in pairs(Character:GetChildren()) do
				if v:IsA("Humanoid") then
					Humanoid = v
					break
				end
			end
			Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
			Humanoid.Jump = true
		end
	end
end

function PlayerSeated(Child)
	local function BreakWeld()
		Debris:AddItem(Child, 0.5)
		if Child and Child.Parent then
			Child:Destroy()
		end
	end
	if not Child:IsA("Weld") or not Child.Name == "SeatWeld" then
		return
	end
	if Child.Part0 ~= Seat or not Child.Part1 or not Child.Part1.Parent then
		return
	end
	Child.C1 = (Child.C1 * CFrame.new(0, 0.5, 0.375))
	local character = Child.Part1.Parent
	local humanoid = character:FindFirstChild("Humanoid")
	if humanoid then
		local Animation = Animations.Ride
		RideTrack = humanoid:LoadAnimation(Animation.Animation)
		RideTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed)
	end
	local Player = Players:GetPlayerFromCharacter(character)
	if not Player then
		BreakWeld()
		return
	end
	local PlayerGui = Player:FindFirstChild("PlayerGui")
	if not PlayerGui then
		BreakWeld()
		return
	end
	InteractiveControlCopy = InteractiveControl:Clone()
	local ServerCommunication = Instance.new("ObjectValue")
	ServerCommunication.Name = "ServerControl"
	ServerCommunication.Value = ServerControl
	ServerCommunication.Parent = InteractiveControlCopy
	InteractiveControlCopy.Disabled = false
	InteractiveControlCopy.Parent = PlayerGui
	Rider = Player
end

function PlayerDismounted(Child)
	if not Child:IsA("Weld") or not Child.Name == "SeatWeld" then
		return
	end
	if not Child.Part1 or not Child.Part1.Parent then
		return
	end
	local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
	if not Player or Player ~= Rider then
		return
	end
	if InteractiveControlCopy and InteractiveControlCopy.Parent then
		InteractiveControlCopy:Destroy()
	end
	if RideTrack then
		RideTrack:Stop()
	end
	Rider = nil
end

RunService.Heartbeat:connect(Animate)
Seat.ChildAdded:connect(PlayerSeated)
Seat.ChildRemoved:connect(PlayerDismounted)
