AI roblox Speed change
Key RequiredUniversal

AI roblox Speed change

Universal ScriptAI_Scripter_JPAI_Scripter_JP 349 views 401 executesUpdated Jan 26, 2026
Unrated
00
Lua Script•116 lines (3107 chars)
-- ======================================
-- R6 Speed Slider UI
-- LocalScript
-- ======================================

local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local player = Players.LocalPlayer

-- 設定
local MIN_SPEED = 5
local MAX_SPEED = 100
local DEFAULT_SPEED = 16

-- GUI作成
local gui = Instance.new("ScreenGui")
gui.Name = "SpeedUI"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")

local frame = Instance.new("Frame")
frame.Size = UDim2.fromScale(0.6, 0.18)
frame.Position = UDim2.fromScale(0.2, 0.75)
frame.BackgroundColor3 = Color3.fromRGB(30,30,30)
frame.BorderSizePixel = 0
frame.Parent = gui
frame.Active = true
frame.Draggable = true

local corner = Instance.new("UICorner", frame)
corner.CornerRadius = UDim.new(0,16)

local title = Instance.new("TextLabel")
title.Size = UDim2.fromScale(1,0.3)
title.BackgroundTransparency = 1
title.Text = "R6 Speed Controller"
title.TextColor3 = Color3.new(1,1,1)
title.TextScaled = true
title.Parent = frame

-- スライダーバー
local bar = Instance.new("Frame")
bar.Size = UDim2.fromScale(0.9,0.2)
bar.Position = UDim2.fromScale(0.05,0.6)
bar.BackgroundColor3 = Color3.fromRGB(60,60,60)
bar.BorderSizePixel = 0
bar.Parent = frame

local barCorner = Instance.new("UICorner", bar)

local fill = Instance.new("Frame")
fill.Size = UDim2.fromScale((DEFAULT_SPEED-MIN_SPEED)/(MAX_SPEED-MIN_SPEED),1)
fill.BackgroundColor3 = Color3.fromRGB(0,170,255)
fill.BorderSizePixel = 0
fill.Parent = bar

local fillCorner = Instance.new("UICorner", fill)

local valueLabel = Instance.new("TextLabel")
valueLabel.Size = UDim2.fromScale(1,0.3)
valueLabel.Position = UDim2.fromScale(0,0.3)
valueLabel.BackgroundTransparency = 1
valueLabel.Text = "Speed : "..DEFAULT_SPEED
valueLabel.TextColor3 = Color3.new(1,1,1)
valueLabel.TextScaled = true
valueLabel.Parent = frame

-- Humanoid取得
local humanoid
local function setCharacter(char)
	humanoid = char:WaitForChild("Humanoid")
	if humanoid.RigType ~= Enum.HumanoidRigType.R6 then
		warn("R6専用です")
	end
	humanoid.WalkSpeed = DEFAULT_SPEED
end

if player.Character then
	setCharacter(player.Character)
end
player.CharacterAdded:Connect(setCharacter)

-- スライダー操作
local dragging = false

bar.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1
	or input.UserInputType == Enum.UserInputType.Touch then
		dragging = true
	end
end)

UIS.InputEnded:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1
	or input.UserInputType == Enum.UserInputType.Touch then
		dragging = false
	end
end)

UIS.InputChanged:Connect(function(input)
	if dragging and humanoid then
		if input.UserInputType == Enum.UserInputType.MouseMovement
		or input.UserInputType == Enum.UserInputType.Touch then

			local percent = math.clamp(
				(input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X,
				0, 1
			)

			local speed = math.floor(MIN_SPEED + (MAX_SPEED - MIN_SPEED) * percent)
			fill.Size = UDim2.fromScale(percent,1)
			valueLabel.Text = "Speed : "..speed
			humanoid.WalkSpeed = speed
		end
	end
end)

Features & Information

AI

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts