1. I want to detect if the car is in an powered Area(next to an electric Pole) so i can trigger the charge up and add up the Variable ElectricChargeOfCar which I will be using down below by seconds:
Code: Select all
local clock = os.clock
function wait(n)
local t0 = clock()
while clock() - t0 <= n do end
end
while(true)do
ElectricChargeOfCar = ElectricChargeOfCar + 1
wait(1)
end
Code: Select all
burner = {
fuellevel= ElectricChargeOfCar
}
Somewhere else, don't know where:
if (driving) then
ElectricChargeOfCar = ElectricChargeOfCar - 1
end
I hope you understand this well because I tried to explain my Problem as understandable as possible (with my knowledge of the englisch language, I'm not a native speaker)
I also already thought about solving this Problem by creating a new type like
Code: Select all
type = "newcartype"