local descendants = script.Parent.Parent["DU-300 Heavy SPG"]:GetDescendants()
while true do
wait()
for index, descendant in pairs(descendants) do
if descendant:IsA("Seat") or descendant:IsA("VehicleSeat") and descendant.Occupant ~= nil then
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.BrickColor = BrickColor.new("Bright red")
else
script.Parent.ClickDetector.MaxActivationDistance = 100
script.Parent.BrickColor = BrickColor.new("Steel blue")
end
end
end
Here, i'm trying to create a regen lock system.
So when someone is seated in the vehicle, the regen button is locked and unclickable. There are multiple seats in the vehicle, and when i sit in one seat, the regen button rapidly switches from locked to unlocked. How can i fix this?

1 comment
thank you so much, man!