local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Debris = game:GetService("Debris")
local arena = workspace:FindFirstChild("KeyboardArena")
if not arena then
arena = Instance.new("Folder")
arena.Name = "KeyboardArena"
arena.Parent = workspace
end
-- Создаём платформу
local floor = Instance.new("Part")
floor.Size = Vector3.new(120, 2, 120)
floor.Position = Vector3.new(0, 0, 0)
floor.Anchored = true
floor.Material = Enum.Material.SmoothPlastic
floor.Color = Color3.fromRGB(35, 35, 35)
floor.Name = "Floor"
floor.Parent = arena
-- Спавн
local spawnPart = Instance.new("SpawnLocation")
spawnPart.Size = Vector3.new(10, 1, 10)
spawnPart.Position = Vector3.new(0, 4, 0)
spawnPart.Anchored = true
spawnPart.Neutral = true
spawnPart.Material = Enum.Material.Neon
spawnPart.Color = Color3.fromRGB(0, 255, 120)
spawnPart.Name = "Spawn"
spawnPart.Parent = arena
local function makeKey()
local key = Instance.new("Part")
key.Size = Vector3.new(4, 1, 2)
key.Anchored = false
key.CanCollide = false
key.Material = Enum.Material.Metal
key.Color = Color3.fromRGB(math.random(50, 255), math.random(50, 255), math.random(50, 255))
key.Name = "FlyingKey"
local x = math.random(-50, 50)
local z = math.random(-50, 50)
local y = math.random(20, 40)
key.Position = Vector3.new(x, y, z)
key.Parent = arena
local bodyVel = Instance.new("BodyVelocity")
bodyVel.Velocity = Vector3.new(math.random(-30, 30), math.random(-10, 10), math.random(-30, 30))
bodyVel.MaxForce = Vector3.new(1e6, 1e6, 1e6)
bodyVel.Parent = key
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.CFrame = CFrame.new()
bodyGyro.MaxTorque = Vector3.new(1e6, 1e6, 1e6)
bodyGyro.P = 3000
bodyGyro.Parent = key
key.Touched:Connect(function(hit)
local hum = hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid")
if hum then
hum:TakeDamage(20)
end
end)
Debris:AddItem(key, 8)
end
-- Спавн клавиш
task.spawn(function()
while true do
task.wait(1)
for i = 1, 3 do
makeKey()
end
end
end)
-- Бонус: чуть подталкиваем игроков, чтобы было веселее
local function setupCharacter(character)
local hum = character:WaitForChild("Humanoid")
hum.WalkSpeed = 16
hum.JumpPower = 50
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(setupCharacter)
end)
for _, player in ipairs(Players:GetPlayers()) do
if player.Character then
setupCharacter(player.Character)
end
end