local function T(T)norm.BackgroundColor3=Color3.fromRGB(255,255,255)fast.BackgroundColor3=Color3.fromRGB(255,255,255)max.BackgroundColor3=Color3.fromRGB(255,255,255)local S local v if T==norm then S=normalSize v=normalSpd elseif T==fast then S=fastSize v=fastSpd elseif T==max then S=maxSize v=maxSpd end uiSpeedUser.Value=v if ClipSettings.settings.uiSpeedSetting then ClipSettings.islandSpeed=uiSpeedUser.Value else ClipSettings.islandSpeed=ClipSettings.islandSpeed end local t=TweenService:Create(sliding,tweenInfo,{Size=S})t:Play()T.BackgroundColor3=Color3.fromRGB(200,200,200)end

local function onSliderButtonClick(button)
	-- Reset button colors
	norm.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
	fast.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
	max.BackgroundColor3 = Color3.fromRGB(255, 255, 255)

	-- Move the sliding indicator to the selected button
	local targetSize
	local targetSpeed

	if button == norm then
		targetSize = normalSize
		targetSpeed = normalSpd
	elseif button == fast then
		targetSize = fastSize
		targetSpeed = fastSpd
	elseif button == max then
		targetSize = maxSize
		targetSpeed = maxSpd
	end

	-- Set the uiSpeedUser to the selected speed modifier
	uiSpeedUser.Value = targetSpeed

	-- Check if the user has permission to change the islandSpeed
	if ClipSettings.settings.uiSpeedSetting then
		-- Update the islandSpeed setting in the ClipSettings module based on the uiSpeedUser
		ClipSettings.islandSpeed = uiSpeedUser.Value
	else
		-- Use the default islandSpeed from the ClipSettings module if uiSpeedSetting is off
		ClipSettings.islandSpeed = ClipSettings.islandSpeed
	end

	-- Animate the sliding indicator
	local tween = TweenService:Create(sliding, tweenInfo, {
		Size = targetSize
	})
	tween:Play()

	-- Highlight the selected button
	button.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
end

