ServerScriptService.EventsSearch.Search:9: attempt to index local 'hit' (a nil value)
--// For Fill detector //--
local Fill = Instance.new("RemoteEvent", workspace.Events)
Fill.Name = "FillEvent"
Fill.OnServerEvent:connect(function(player, hit)
warn(player.Name)
local ready = false
if hit.Name == "DriveSeat" then
warn("OK, working FAR")
car = hit
ready = true
if hit.Fuel.Value < 10 and ready then
repeat wait(0.2) car.Fuel.Value = car.Fuel.Value + 0.2 until
ready == false or hit.Fuel.Value > 9.99
end
end
end)
script.Parent.TouchEnded:connect(function(y)
local ready = false
if y == car then
ready = false
end
end)

1 comment
The 'hit' parameter is nil. That means that whatever is firing the event isn't providing a parameter. Check your script that fires the Fill Event.