local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local localPlayer = Players.LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
local proximityPrompt = game:GetService("Workspace"):WaitForChild("Map")
:WaitForChild("POI")
:WaitForChild("SpinnerGames")
:WaitForChild("Board")
:WaitForChild("Button")
:WaitForChild("Button")
:WaitForChild("ProximityPrompt")
-- State
local isRunning = false
local isUIVisible = true
local isDragging = false
local dragOffset = Vector2.new(0, 0)
-- UI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "ToggleGui"
screenGui.ResetOnSpawn = false
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screenGui.Parent = localPlayer:WaitForChild("PlayerGui")
-- Outer Frame
local outerFrame = Instance.new("Frame")
outerFrame.Size = UDim2.new(0, 160, 0, 72)
outerFrame.Position = UDim2.new(0, 20, 0.5, -36)
outerFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
outerFrame.BorderSizePixel = 0
outerFrame.Active = true
outerFrame.ClipsDescendants = true
outerFrame.Parent = screenGui
local outerCorner = Instance.new("UICorner")
outerCorner.CornerRadius = UDim.new(0, 14)
outerCorner.Parent = outerFrame
-- Shadow
local shadow = Instance.new("ImageLabel")
shadow.Size = UDim2.new(1, 20, 1, 20)
shadow.Position = UDim2.new(0, -10, 0, -10)
shadow.BackgroundTransparency = 1
shadow.Image = "rbxassetid://5028857084"
shadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
shadow.ImageTransparency = 0.6
shadow.ScaleType = Enum.ScaleType.Slice
shadow.SliceCenter = Rect.new(24, 24, 276, 276)
shadow.ZIndex = 0
shadow.Parent = outerFrame
-- Terminate Background
local terminateBg = Instance.new("Frame")
terminateBg.Size = UDim2.new(1, -20, 0, 30)
terminateBg.Position = UDim2.new(0, 10, 0, -14)
terminateBg.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
terminateBg.BorderSizePixel = 0
terminateBg.ZIndex = 2
terminateBg.Parent = outerFrame
local terminateCorner = Instance.new("UICorner")
terminateCorner.CornerRadius = UDim.new(0, 10)
terminateCorner.Parent = terminateBg
-- Terminate Text
local terminateBtn = Instance.new("TextButton")
terminateBtn.Size = UDim2.new(1, -20, 0, 16)
terminateBtn.Position = UDim2.new(0, 10, 0, 0)
terminateBtn.BackgroundTransparency = 1
terminateBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
terminateBtn.Text = "Terminate"
terminateBtn.Font = Enum.Font.GothamBold
terminateBtn.TextSize = 11
terminateBtn.ZIndex = 3
terminateBtn.Parent = outerFrame
-- Hover Effect
terminateBtn.MouseEnter:Connect(function()
terminateBg.BackgroundColor3 = Color3.fromHex("#8A4137")
end)
terminateBtn.MouseLeave:Connect(function()
terminateBg.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
end)
-- Toggle Button
local button = Instance.new("TextButton")
button.Size = UDim2.new(1, -20, 0, 46)
button.Position = UDim2.new(0, 10, 0, 20)
button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.Text = "● OFF"
button.Font = Enum.Font.GothamBold
button.TextSize = 16
button.BorderSizePixel = 0
button.ZIndex = 2
button.Parent = outerFrame
local buttonCorner = Instance.new("UICorner")
buttonCorner.CornerRadius = UDim.new(0, 10)
buttonCorner.Parent = button
-- Dragging Logic
outerFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
isDragging = true
local mousePos = UserInputService:GetMouseLocation()
local framePos = outerFrame.AbsolutePosition
dragOffset = Vector2.new(mousePos.X - framePos.X, mousePos.Y - framePos.Y)
end
end)
outerFrame.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
isDragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if isDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local mousePos = UserInputService:GetMouseLocation()
local screenSize = screenGui.AbsoluteSize
local frameSize = outerFrame.AbsoluteSize
local newX = math.clamp(mousePos.X - dragOffset.X, 0, screenSize.X - frameSize.X)
local newY = math.clamp(mousePos.Y - dragOffset.Y, 0, screenSize.Y - frameSize.Y)
outerFrame.Position = UDim2.new(0, newX, 0, newY)
end
end)
-- Terminate
terminateBtn.MouseButton1Click:Connect(function()
isRunning = false
screenGui:Destroy()
end)
-- Button Toggle
button.MouseButton1Click:Connect(function()
isRunning = not isRunning
if isRunning then
button.Text = "● ON"
button.BackgroundColor3 = Color3.fromRGB(50, 160, 80)
task.spawn(function()
while isRunning do
if not proximityPrompt.Enabled then
repeat
proximityPrompt:GetPropertyChangedSignal("Enabled"):Wait()
until proximityPrompt.Enabled or not isRunning
end
if not isRunning then break end
local distance = (rootPart.Position - proximityPrompt.Parent.Position).Magnitude
if distance <= proximityPrompt.MaxActivationDistance then
fireproximityprompt(proximityPrompt)
end
task.wait(0.1)
end
end)
else
button.Text = "● OFF"
button.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
end
end)
-- RSTRG = UI Toggle
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.RightControl then
isUIVisible = not isUIVisible
outerFrame.Visible = isUIVisible
end
end)
Comments
No comments yet
Be the first to share your thoughts!