-- Services local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local root = character:WaitForChild("HumanoidRootPart") -- Attachment & LinearVelocity local attachment = Instance.new("Attachment", root) local velocity = Instance.new("LinearVelocity") velocity.Attachment0 = attachment velocity.RelativeTo = Enum.ActuatorRelativeTo.World velocity.MaxForce = math.huge velocity.VectorVelocity = Vector3.zero velocity.Parent = root -- 設定値 local speedMultiplier = 0 local verticalSpeed = 0 local verticalInput = 0 -- -1 ~ 1 -- GUI local gui = Instance.new("ScreenGui", player.PlayerGui) gui.ResetOnSpawn = false local frame = Instance.new("Frame", gui) frame.Size = UDim2.new(0, 240, 0, 200) frame.Position = UDim2.new(0.5, -120, 0.6, 0) frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) frame.Active = true frame.Draggable = true Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12) local title = Instance.new("TextLabel", frame) title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundTransparency = 1 title.Text = "Speed / Fly Control" title.TextColor3 = Color3.new(1,1,1) title.TextScaled = true title.Font = Enum.Font.SourceSansBold -- 横移動速度入力 local box = Instance.new("TextBox", frame) box.Size = UDim2.new(1, -20, 0, 40) box.Position = UDim2.new(0, 10, 0, 40) box.BackgroundColor3 = Color3.fromRGB(20, 20, 20) box.TextColor3 = Color3.new(1,1,1) box.PlaceholderText = "横移動加速量 (例: 10)" box.TextScaled = true box.Font = Enum.Font.SourceSans Instance.new("UICorner", box).CornerRadius = UDim.new(0, 8) box.FocusLost:Connect(function() speedMultiplier = tonumber(box.Text) or 0 end) -- 上昇ボタン local up = Instance.new("TextButton", frame) up.Size = UDim2.new(0.45, 0, 0, 40) up.Position = UDim2.new(0.05, 0, 0, 100) up.Text = "▲" up.TextScaled = true up.BackgroundColor3 = Color3.fromRGB(30,30,30) up.TextColor3 = Color3.new(1,1,1) Instance.new("UICorner", up) -- 下降ボタン local down = Instance.new("TextButton", frame) down.Size = UDim2.new(0.45, 0, 0, 40) down.Position = UDim2.new(0.5, 0, 0, 100) down.Text = "▼" down.TextScaled = true down.BackgroundColor3 = Color3.fromRGB(30,30,30) down.TextColor3 = Color3.new(1,1,1) Instance.new("UICorner", down) verticalSpeed = 20 -- 押しっぱなし対応 up.MouseButton1Down:Connect(function() verticalInput = 1 end) up.MouseButton1Up:Connect(function() verticalInput = 0 end) down.MouseButton1Down:Connect(function() verticalInput = -1 end) down.MouseButton1Up:Connect(function() verticalInput = 0 end) -- 移動処理 RunService.RenderStepped:Connect(function() local horizontal = humanoid.MoveDirection * speedMultiplier local vertical = Vector3.new(0, verticalInput * verticalSpeed, 0) velocity.VectorVelocity = horizontal + vertical end)