Description

local VirtualInputManager = game:GetService("VirtualInputManager")

local CoreGui = game:GetService("CoreGui")

local Players = game:GetService("Players")

local player = Players.LocalPlayer

if CoreGui:FindFirstChild("VirtualCarKeyboardUI") then CoreGui.VirtualCarKeyboardUI:Destroy() end

local gui = Instance.new("ScreenGui", CoreGui:FindFirstChild("PlayerGui") and player.PlayerGui or CoreGui)

gui.Name, gui.ResetOnSpawn = "VirtualCarKeyboardUI", false

local function createBtn(name, text, pos, size)

local btn = Instance.new("TextButton", gui)

btn.Name, btn.Text, btn.Position, btn.Size = name, text, pos, size

btn.BackgroundColor3, btn.TextColor3, btn.TextScaled, btn.Font = Color3.fromRGB(25, 25, 25), Color3.new(1,1,1), true, Enum.Font.SourceSansBold

btn.BackgroundTransparency = 0.25

Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 12)

return btn

end

-- Tuşları Tanımla (Konum ve İsimler)

local buttons = {

{createBtn("BtnW", "GAZ (W) ⬆", UDim2.new(0.82, 0, 0.20, 0), UDim2.new(0.13, 0, 0.22, 0)), Enum.KeyCode.W},

{createBtn("BtnS", "FREN (S) ⬇", UDim2.new(0.82, 0, 0.52, 0), UDim2.new(0.13, 0, 0.22, 0)), Enum.KeyCode.S},

{createBtn("BtnA", "SOL (A) ⬅", UDim2.new(0.04, 0, 0.57, 0), UDim2.new(0.13, 0, 0.17, 0)), Enum.KeyCode.A},

{createBtn("BtnD", "SAĞ (D) ➡", UDim2.new(0.18, 0, 0.57, 0), UDim2.new(0.13, 0, 0.17, 0)), Enum.KeyCode.D}

}

-- Otomatik Tuş Bağlama

for _, data in ipairs(buttons) do

local btn, key = data[1], data[2]

local defColor = btn.BackgroundColor3

btn.InputBegan:Connect(function(input)

if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then

btn.BackgroundColor3 = Color3.fromRGB(0, 170, 255)

VirtualInputManager:SendKeyEvent(true, key, false, game)

end

end)

btn.InputEnded:Connect(function(input)

if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then

btn.BackgroundColor3 = defColor

VirtualInputManager:SendKeyEvent(false,

key, false, game)

end

end)

end

Game Page

💕 Drive World 🏎️ Drifting & Racing

Roblox
Views
413
Likes
0
Dislikes
0
Posted
3w ago
Key System
No
Mobile
Supported