local function m()GetInStart:FireServer(AdornedSeat)while EnterKeyDown and AdornedSeat do wait()end if AdornedSeat then Remotes.GetInSeat:FireServer(AdornedSeat)local m=0 repeat wait()m=m+1 until AdornedSeat==nil or m>20 EnterImageButton.Visible=true local E=getLocalHumanoid()if E then if E.Sit then local m=getLocalHumanoid()if m~=currentHumanoid then currentHumanoid=m local E=animationFolder:GetChildren()for M=1,#E,1 do AnimationTracks[E[M].Name]=m:LoadAnimation(E[M])end end local E=m.SeatPart local M=E.ClassName=="\086\101\104\105\099\108\101\083\101\097\116"and"\068\114\105\118\101\114"or"\080\097\115\115\101\110\103\101\114"local Q=AnimationTracks[M.."\095\083\101\097\116\101\100"]if Q then Q.Priority=Enum.AnimationPriority.Action Q:Play()end end end end end
--Get in a seat
local function enterStart()
	--Tell server we're trying to get in
	GetInStart:FireServer(AdornedSeat)

	--Wait until player lets go of button (causing them to get in) or seat out of range (nothing happens)
	while EnterKeyDown and AdornedSeat do
		wait()
	end

	if AdornedSeat then
		--Tell server we are getting in seat
		Remotes.GetInSeat:FireServer(AdornedSeat)
		local n = 0
		repeat
			wait()
			n = n + 1
		until AdornedSeat == nil or n > 20
		EnterImageButton.Visible = true

		local hum = getLocalHumanoid()
		if hum then
			if hum.Sit then
				-- load animations only when player is in the vehicle
				local hum = getLocalHumanoid()
				if hum ~= currentHumanoid then -- load only when we have a new humanoid
					currentHumanoid = hum
					local anims = animationFolder:GetChildren()
					for i = 1, #anims do
						AnimationTracks[anims[i].Name] = hum:LoadAnimation(anims[i])
					end
				end

				-- play seated animation
				local seat = hum.SeatPart
				local prefix = (seat.ClassName == "VehicleSeat" and "Driver" or "Passenger")
				local preferredAnimation = AnimationTracks[prefix .. "_Seated"]
				if preferredAnimation then
					preferredAnimation.Priority = Enum.AnimationPriority.Action
					preferredAnimation:Play()
				end
			end
		end
	end
end
