local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") -- Get local player local player = Players.LocalPlayer local gui = Instance.new("ScreenGui") gui.Name = "SimulationRadiusGUI" gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.Parent = player:WaitForChild("PlayerGui") -- Main frame local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 320, 0, 180) frame.Position = UDim2.new(0.5, -160, 0.5, -90) frame.AnchorPoint = Vector2.new(0.5, 0.5) frame.BackgroundColor3 = Color3.fromRGB(45, 45, 45) frame.BorderSizePixel = 0 frame.ClipsDescendants = true frame.Parent = gui -- Corner rounding local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = frame -- Drop shadow local shadow = Instance.new("ImageLabel") shadow.Image = "rbxassetid://5554236805" shadow.ScaleType = Enum.ScaleType.Slice shadow.SliceCenter = Rect.new(23, 23, 277, 277) shadow.Size = UDim2.new(1, 30, 1, 30) shadow.Position = UDim2.new(0, -15, 0, -15) shadow.BackgroundTransparency = 1 shadow.ZIndex = -1 shadow.Parent = frame -- Title bar (for dragging) local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1, 0, 0, 30) titleBar.Position = UDim2.new(0, 0, 0, 0) titleBar.BackgroundColor3 = Color3.fromRGB(35, 35, 35) titleBar.BorderSizePixel = 0 titleBar.Name = "TitleBar" titleBar.Parent = frame local titleCorner = Instance.new("UICorner") titleCorner.CornerRadius = UDim.new(0, 8) titleCorner.Parent = titleBar -- Title text local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -40, 1, 0) title.Position = UDim2.new(0, 10, 0, 0) title.BackgroundTransparency = 1 title.TextColor3 = Color3.fromRGB(255, 255, 255) title.Text = "Simulation Radius Controller" title.Font = Enum.Font.GothamBold title.TextSize = 16 title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = titleBar -- Close button local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.new(0, 30, 0, 30) closeButton.Position = UDim2.new(1, -30, 0, 0) closeButton.BackgroundTransparency = 1 closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.Text = "X" closeButton.Font = Enum.Font.GothamBold closeButton.TextSize = 18 closeButton.Parent = titleBar -- Content area local content = Instance.new("Frame") content.Size = UDim2.new(1, -20, 1, -40) content.Position = UDim2.new(0, 10, 0, 35) content.BackgroundTransparency = 1 content.Parent = frame -- Value display local valueLabel = Instance.new("TextLabel") valueLabel.Size = UDim2.new(1, 0, 0, 30) valueLabel.Position = UDim2.new(0, 0, 0, 0) valueLabel.BackgroundTransparency = 1 valueLabel.TextColor3 = Color3.fromRGB(200, 200, 200) valueLabel.Text = "Radius: 0" valueLabel.Font = Enum.Font.Gotham valueLabel.TextSize = 16 valueLabel.TextXAlignment = Enum.TextXAlignment.Left valueLabel.Parent = content -- Slider container local sliderContainer = Instance.new("Frame") sliderContainer.Size = UDim2.new(1, 0, 0, 40) sliderContainer.Position = UDim2.new(0, 0, 0, 35) sliderContainer.BackgroundTransparency = 1 sliderContainer.Parent = content -- Slider track local track = Instance.new("Frame") track.Size = UDim2.new(1, 0, 0, 6) track.Position = UDim2.new(0, 0, 0.5, -3) track.BackgroundColor3 = Color3.fromRGB(80, 80, 80) track.BorderSizePixel = 0 track.Name = "Track" track.Parent = sliderContainer local trackCorner = Instance.new("UICorner") trackCorner.CornerRadius = UDim.new(1, 0) trackCorner.Parent = track -- Slider fill local fill = Instance.new("Frame") fill.Size = UDim2.new(0, 0, 1, 0) fill.BackgroundColor3 = Color3.fromRGB(0, 162, 255) fill.BorderSizePixel = 0 fill.Name = "Fill" fill.Parent = track local fillCorner = Instance.new("UICorner") fillCorner.CornerRadius = UDim.new(1, 0) fillCorner.Parent = fill -- Slider thumb local thumb = Instance.new("TextButton") thumb.Size = UDim2.new(0, 20, 0, 20) thumb.Position = UDim2.new(0, -10, 0.5, -10) thumb.BackgroundColor3 = Color3.fromRGB(255, 255, 255) thumb.Text = "" thumb.AutoButtonColor = false thumb.Name = "Thumb" thumb.ZIndex = 2 thumb.Parent = track local thumbCorner = Instance.new("UICorner") thumbCorner.CornerRadius = UDim.new(1, 0) thumbCorner.Parent = thumb -- Status text local statusText = Instance.new("TextLabel") statusText.Size = UDim2.new(1, 0, 0, 20) statusText.Position = UDim2.new(0, 0, 1, -25) statusText.BackgroundTransparency = 1 statusText.TextColor3 = Color3.fromRGB(150, 150, 150) statusText.Text = "Drag the slider to change radius" statusText.Font = Enum.Font.Gotham statusText.TextSize = 12 statusText.Parent = content -- Min/Max labels local minLabel = Instance.new("TextLabel") minLabel.Size = UDim2.new(0, 30, 0, 20) minLabel.Position = UDim2.new(0, 0, 1, -5) minLabel.BackgroundTransparency = 1 minLabel.TextColor3 = Color3.fromRGB(150, 150, 150) minLabel.Text = "0" minLabel.Font = Enum.Font.Gotham minLabel.TextSize = 12 minLabel.TextXAlignment = Enum.TextXAlignment.Left minLabel.Parent = sliderContainer local maxLabel = Instance.new("TextLabel") maxLabel.Size = UDim2.new(0, 40, 0, 20) maxLabel.Position = UDim2.new(1, -40, 1, -5) maxLabel.BackgroundTransparency = 1 maxLabel.TextColor3 = Color3.fromRGB(150, 150, 150) maxLabel.Text = "100" maxLabel.Font = Enum.Font.Gotham maxLabel.TextSize = 12 maxLabel.TextXAlignment = Enum.TextXAlignment.Right maxLabel.Parent = sliderContainer -- Mobile touch button (for better mobile interaction) local mobileTouchButton = Instance.new("TextButton") mobileTouchButton.Size = UDim2.new(1, 0, 1, 0) mobileTouchButton.Position = UDim2.new(0, 0, 0, 0) mobileTouchButton.BackgroundTransparency = 1 mobileTouchButton.Text = "" mobileTouchButton.Visible = false mobileTouchButton.Parent = sliderContainer -- Variables local currentRadius = 0 local isDragging = false local isMobile = UserInputService.TouchEnabled and not UserInputService.MouseEnabled -- Function to update the radius local function updateRadius(value) currentRadius = value valueLabel.Text = "Radius: " .. tostring(math.floor(value)) -- Update slider UI local percent = value / 100 fill.Size = UDim2.new(percent, 0, 1, 0) thumb.Position = UDim2.new(percent, -10, 0.5, -10) -- Update the actual SimulationRadius pcall(function() sethiddenproperty(player, "SimulationRadius", value) end) end -- Slider interaction logic local function onInputChanged(input) if isDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local trackAbsolutePos = track.AbsolutePosition local trackAbsoluteSize = track.AbsoluteSize -- Calculate position based on input type local position if input.UserInputType == Enum.UserInputType.MouseMovement then position = input.Position else position = input.Position end -- Calculate percentage local percent = (position.X - trackAbsolutePos.X) / trackAbsoluteSize.X percent = math.clamp(percent, 0, 1) updateRadius(percent * 100) end end local function onInputEnded(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then isDragging = false if isMobile then mobileTouchButton.Visible = false end end end -- Desktop interaction thumb.MouseButton1Down:Connect(function() isDragging = true end) track.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then isDragging = true local percent = (input.Position.X - track.AbsolutePosition.X) / track.AbsoluteSize.X updateRadius(math.clamp(percent * 100, 0, 100)) end end) -- Mobile interaction if isMobile then mobileTouchButton.Visible = true mobileTouchButton.TouchTap:Connect(function(touchPositions) if not isDragging then isDragging = true mobileTouchButton.Visible = false end end) track.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch then isDragging = true mobileTouchButton.Visible = false local percent = (input.Position.X - track.AbsolutePosition.X) / track.AbsoluteSize.X updateRadius(math.clamp(percent * 100, 0, 100)) end end) end -- Connect input events UserInputService.InputChanged:Connect(onInputChanged) UserInputService.InputEnded:Connect(onInputEnded) -- Close button functionality closeButton.MouseButton1Click:Connect(function() gui:Destroy() end) -- Make the GUI draggable local dragging local dragInput local dragStart local startPos local function updateDrag(input) local delta = input.Position - dragStart frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) titleBar.InputChanged:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if input == dragInput and dragging then updateDrag(input) end end) -- Initialize at 0 updateRadius(0) -- Make GUI responsive for mobile if isMobile then frame.Size = UDim2.new(0, 300, 0, 200) frame.Position = UDim2.new(0.5, -150, 0.5, -100) -- Make touch areas larger for mobile thumb.Size = UDim2.new(0, 30, 0, 30) thumb.Position = UDim2.new(0, -15, 0.5, -15) titleBar.Size = UDim2.new(1, 0, 0, 40) title.TextSize = 18 closeButton.TextSize = 20 closeButton.Size = UDim2.new(0, 40, 0, 40) closeButton.Position = UDim2.new(1, -40, 0, 0) statusText.Text = "Tap and drag the slider to change radius" end