This is the script, I am also using the plugin, Tag Editor
local SEATS_TAG = "Passenger Seat"
local SIT_DISTANCE = 10
local cs = game:GetService("CollectionService")
local cas = game:GetService("ContextActionService")
local player = game.Players.LocalPlayer
local humanoid = script.Parent:WaitForChild("Humanoid")
local seats = cs:GetTagged(SEATS_TAG)
local closestSeat = nil
function SitRequest(name, state, input)
if (state == Enum.UserInputState.Begin) then
if (closestSeat) then
if (humanoid.Sit) then
humanoid.Jump = true
else
closestSeat:Sit(humanoid)
end
end
end
end
cs:GetInstanceAddedSignal(SEATS_TAG):Connect(function(seat)
table.insert(seats, seat)
end)
cs:GetInstanceRemovedSignal(SEATS_TAG):Connect(function(seat)
seats = cs:GetTagged(SEATS_TAG)
end)
cas:BindAction("SitRequest", SitRequest, false, Enum.KeyCode.E, Enum.KeyCode.ButtonX)
while (true) do
local seat = nil
local minDist = math.huge
for _,s in pairs(seats) do
local distance = player:DistanceFromCharacter(s.Position)
if (distance < SIT_DISTANCE and distance < minDist) then
seat = s
minDist = distance
end
end
closestSeat = seat
player.PlayerGui.Gui.SitMessage.Visible = (seat ~= nil and not humanoid.Sit)
wait(0.1)
end
COMMUNITY QUESTION
I have this E to sit script and it isn't working. How do I fix this?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Please use Code Blocks when inserting an Script. You can do it easily by Editing the post, selecting the script and clicking on the Lua button
I doubt anyone can assist you with your script looking like that. Put it in CODE BLOCKS.
This is a non-constructive question. Do not take a free model script and expect for us to fix it. Write your own scripts next time.