-- LocalScript (StarterPlayer > StarterPlayerScripts) local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") -- ScreenGui local screenGui = Instance.new("ScreenGui") screenGui.Name = "ExampleUI" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui -- UIScale local uiScale = Instance.new("UIScale") uiScale.Parent = screenGui -- Main frame local frame = Instance.new("Frame") frame.Size = UDim2.fromScale(0.3, 0.3) frame.Position = UDim2.fromScale(0.5, 0.5) frame.AnchorPoint = Vector2.new(0.5, 0.5) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.Parent = screenGui local frameCorner = Instance.new("UICorner") frameCorner.CornerRadius = UDim.new(0.05, 0) frameCorner.Parent = frame -- Title local title = Instance.new("TextLabel") title.Size = UDim2.fromScale(1, 0.2) title.BackgroundTransparency = 1 title.Text = "Blade Spin" title.TextScaled = true title.Font = Enum.Font.GothamBold title.TextColor3 = Color3.new(1, 1, 1) title.Parent = frame -- Middle text local middleText = Instance.new("TextLabel") middleText.Size = UDim2.fromScale(1, 0.3) middleText.Position = UDim2.fromScale(0, 0.25) -- below title middleText.BackgroundTransparency = 1 middleText.Text = "Make sure to enter the game area, and also avoid pressing the Infinite XP button twice, as this may cause lag or break the script." middleText.TextScaled = true middleText.Font = Enum.Font.Gotham middleText.TextColor3 = Color3.new(1, 1, 1) middleText.Parent = frame -- Close (X) button anchored top-right with padding local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.fromScale(0.08, 0.22) closeButton.Position = UDim2.fromScale(0.98, 0.04) -- inset from top and right closeButton.AnchorPoint = Vector2.new(1, 0) closeButton.Text = "X" closeButton.TextScaled = true closeButton.Font = Enum.Font.GothamBold closeButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60) closeButton.TextColor3 = Color3.new(1, 1, 1) closeButton.Parent = frame local closeCorner = Instance.new("UICorner") closeCorner.CornerRadius = UDim.new(0.3, 0) closeCorner.Parent = closeButton -- Left button local leftButton = Instance.new("TextButton") leftButton.Size = UDim2.fromScale(0.35, 0.25) leftButton.Position = UDim2.fromScale(0.05, 0.65) leftButton.Text = "Infinite XP" leftButton.TextScaled = true leftButton.Font = Enum.Font.Gotham leftButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60) leftButton.TextColor3 = Color3.new(1, 1, 1) leftButton.Parent = frame local leftCorner = Instance.new("UICorner") leftCorner.CornerRadius = UDim.new(0.2, 0) leftCorner.Parent = leftButton -- Right button local rightButton = Instance.new("TextButton") rightButton.Size = UDim2.fromScale(0.35, 0.25) rightButton.Position = UDim2.fromScale(0.6, 0.65) rightButton.Text = "Infinite Coins" rightButton.TextScaled = true rightButton.Font = Enum.Font.Gotham rightButton.BackgroundColor3 = Color3.fromRGB(60, 60, 60) rightButton.TextColor3 = Color3.new(1, 1, 1) rightButton.Parent = frame local rightCorner = Instance.new("UICorner") rightCorner.CornerRadius = UDim.new(0.2, 0) rightCorner.Parent = rightButton -- Button actions leftButton.MouseButton1Click:Connect(function() -- Add XP 1000 times for i = 1, 1000 do local args = {100000} game:GetService("ReplicatedStorage") :WaitForChild("ReplicatedStorageHolders") :WaitForChild("Events") :WaitForChild("AddXP") :FireServer(unpack(args)) end print("XP added 1000 times") end) rightButton.MouseButton1Click:Connect(function() -- Add Coins 10000 times for i = 1, 10000 do local args = {100000} game:GetService("ReplicatedStorage") :WaitForChild("ReplicatedStorageHolders") :WaitForChild("Events") :WaitForChild("AddCoins") :FireServer(unpack(args)) end print("Coins added 10000 times") end) closeButton.MouseButton1Click:Connect(function() screenGui:Destroy() end) --[[ Drag Function (Fixed for keyboard input) ]]-- local dragging = false local dragStart = Vector3.new() local startPos = UDim2.new() local function updatePosition(input) -- Only respond to MouseMovement or Touch input if not dragging then return end if input.UserInputType ~= Enum.UserInputType.MouseMovement and input.UserInputType ~= Enum.UserInputType.Touch then return end 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 -- Start dragging when clicking/touching the title bar title.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) -- Update position only for mouse/touch movement UserInputService.InputChanged:Connect(updatePosition)