local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local plr = Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:Wait() local hum = char:WaitForChild("Humanoid") local hrp = char:WaitForChild("HumanoidRootPart") -- ===== AUTO ===== local car = Instance.new("Model", workspace) car.Name = "TestCar" local body = Instance.new("Part", car) body.Name = "Body" body.Size = Vector3.new(6,2,10) body.Color = Color3.fromRGB(30,30,30) body.Anchored = false body.CanCollide = true car.PrimaryPart = body local seat = Instance.new("Part", car) seat.Name = "Seat" seat.Size = Vector3.new(2,1,2) seat.Transparency = 0.3 seat.Anchored = false local weldSeat = Instance.new("WeldConstraint", seat) weldSeat.Part0 = body weldSeat.Part1 = seat -- ===== ŚCIANY ===== local function Wall(size, offset) local p = Instance.new("Part", car) p.Size = size p.Transparency = 1 p.CanCollide = true p.Massless = true p.Anchored = false p.CFrame = body.CFrame * CFrame.new(offset) local w = Instance.new("WeldConstraint", p) w.Part0 = body w.Part1 = p end Wall(Vector3.new(1,4,8), Vector3.new(-3.5,2,0)) Wall(Vector3.new(1,4,8), Vector3.new(3.5,2,0)) Wall(Vector3.new(6,4,1), Vector3.new(0,2,5)) Wall(Vector3.new(6,3,1), Vector3.new(0,1,-5)) -- ===== SPAWN ===== task.wait(0.5) car:MoveTo(hrp.Position + Vector3.new(0,3,-18)) seat.CFrame = body.CFrame * CFrame.new(0,1,0) pcall(function() body:SetNetworkOwner(plr) end) -- ===== JAZDA ===== local sitting = false local forward, steer = 0, 0 local speed = 90 local sitWeld = nil -- ===== GUI ===== local gui = Instance.new("ScreenGui", plr.PlayerGui) gui.ResetOnSpawn = false local btn = Instance.new("TextButton", gui) btn.Size = UDim2.new(0,220,0,55) btn.Position = UDim2.new(0.5,-110,0.85,0) btn.BackgroundColor3 = Color3.fromRGB(20,20,20) btn.TextColor3 = Color3.new(1,1,1) btn.TextScaled = true btn.BorderSizePixel = 0 btn.Text = "🚗 WSIĄDŹ" -- ===== SIADANIE (PRAWDZIWE) ===== local function sitInCar() if sitting then return end sitting = true hrp.CFrame = seat.CFrame * CFrame.new(0,1,0) hum.PlatformStand = true hum.AutoRotate = false hum:ChangeState(Enum.HumanoidStateType.Physics) sitWeld = Instance.new("WeldConstraint") sitWeld.Part0 = seat sitWeld.Part1 = hrp sitWeld.Parent = seat btn.Text = "⬇️ WYSIĄDŹ" end local function exitCar() if not sitting then return end sitting = false if sitWeld then sitWeld:Destroy() sitWeld = nil end hum.PlatformStand = false hum.AutoRotate = true hum:ChangeState(Enum.HumanoidStateType.Jumping) btn.Text = "🚗 WSIĄDŹ" end btn.MouseButton1Click:Connect(function() if sitting then exitCar() else sitInCar() end end) -- ===== STEROWANIE ===== UIS.InputBegan:Connect(function(i,gp) if gp then return end if i.KeyCode == Enum.KeyCode.W then forward = 1 end if i.KeyCode == Enum.KeyCode.S then forward = -1 end if i.KeyCode == Enum.KeyCode.A then steer = 1 end if i.KeyCode == Enum.KeyCode.D then steer = -1 end end) UIS.InputEnded:Connect(function(i) if i.KeyCode == Enum.KeyCode.W or i.KeyCode == Enum.KeyCode.S then forward = 0 end if i.KeyCode == Enum.KeyCode.A or i.KeyCode == Enum.KeyCode.D then steer = 0 end end) -- ===== RUCH (STABILNY) ===== RunService.RenderStepped:Connect(function() if sitting then body.AssemblyLinearVelocity = body.CFrame.LookVector * forward * speed body.AssemblyAngularVelocity = Vector3.new(0, steer * 2, 0) else body.AssemblyLinearVelocity = Vector3.zero body.AssemblyAngularVelocity = Vector3.zero end end)