Can somebody help me? I'm trying to figure out where I can check to see if there is a robloxian in my cars! I don't want my cars being respawned while someone sits in them, but I still want them to respawn if someone isn't in them! Help! :(
local RespawnCarsBlock=game.Workspace.RespawnCarsBlock
local Car=game.ServerStorage.Car
function RespawnCars()
print ("R3sp@wN c@rz n0w pl0x.")
for _,object in pairs (game.Workspace:GetChildren())do
if object.Name=="Car"
then
print ("IT'S A CAR! KILL THE INFERIOR BEING!")
object:Destroy()
end
end
for _, object in pairs (game.ServerStorage:GetChildren())do
local CarCopy= object:Clone()
CarCopy.Parent=game.Workspace
CarCopy:MakeJoints()
end
end
RespawnCarsBlock.Touched:connect(RespawnCars)

2 comments
VehicleSeats have a property called Occupant. Just check if that's nil. http://wiki.roblox.com/index.php?title=API:Class/VehicleSeat/Occupant
That is a very hard script to read... try using an 'if' statement