-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] DrewstersCarController local DrewstersCarController = {} -------------------------------------------------- -- SERVICES -------------------------------------------------- local Players = game:GetService("Players") local RunService = game:GetService("RunService") -------------------------------------------------- -- PLAYER -------------------------------------------------- local player = Players.LocalPlayer -------------------------------------------------- -- SETTINGS -------------------------------------------------- DrewstersCarController.MaxSpeed = 5000 DrewstersCarController.Acceleration = 250 DrewstersCarController.CurrentSpeed = 0 -- Gears DrewstersCarController.Gears = { P = 0, -- Park R = -1, -- Reverse N = 0, -- Neutral D = 1 -- Drive } DrewstersCarController.CurrentGear = "P" -------------------------------------------------- -- CAR DETECTION -------------------------------------------------- local function getCar() local character = player.Character if not character then return nil end local humanoid = character:FindFirstChildOfClass("Humanoid") if not humanoid then return nil end local seat = humanoid.SeatPart if seat and seat:IsA("VehicleSeat") then return seat:FindFirstAncestorOfClass("Model"), seat end return nil end -------------------------------------------------- -- GEAR SYSTEM -------------------------------------------------- function DrewstersCarController:SetGear(gear) if self.Gears[gear] == nil then return end self.CurrentGear = gear end function DrewstersCarController:GetGearMultiplier() return self.Gears[self.CurrentGear] or 0 end -------------------------------------------------- -- SPEED SYSTEM -------------------------------------------------- function DrewstersCarController:SetSpeed(speed) self.CurrentSpeed = math.clamp(speed, 0, self.MaxSpeed) end function DrewstersCarController:IncreaseSpeed(amount) self:SetSpeed(self.CurrentSpeed + amount) end function DrewstersCarController:DecreaseSpeed(amount) self:SetSpeed(self.CurrentSpeed - amount) end -------------------------------------------------- -- MAIN UPDATE LOOP -------------------------------------------------- function DrewstersCarController:Start() RunService.Heartbeat:Connect(function() local car, seat = getCar() if not car or not seat then return end local primary = car.PrimaryPart if not primary then return end local gearMultiplier = self:GetGearMultiplier() -- No movement in Park/Neutral if gearMultiplier == 0 then return end local throttle = seat.ThrottleFloat if throttle == 0 then return end local direction = primary.CFrame.LookVector * gearMultiplier local velocity = primary.AssemblyLinearVelocity -- Smooth acceleration system local targetSpeed = self.CurrentSpeed * throttle primary.AssemblyLinearVelocity = Vector3.new( direction.X * targetSpeed, velocity.Y, direction.Z * targetSpeed ) end) end -------------------------------------------------- -- STATUS HELPERS -------------------------------------------------- function DrewstersCarController:GetStatus() return { speed = self.CurrentSpeed, gear = self.CurrentGear } end return DrewstersCarController