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)
Fill.OnServerEvent:connect(function(player, hit) warn(player.Name) local ready = false if hit and hit.Name == "DriveSeat" then -- added a 'if hit' 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)