0% found this document useful (0 votes)
17 views2 pages

HelloWorld Lua

Uploaded by

noverikaosi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

HelloWorld Lua

Uploaded by

noverikaosi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

-- Dapatkan objek Screen GUI

local ScreenGui = Instance.new("ScreenGui")


ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui

-- Set properti GUI


ScreenGui.Enabled = true
ScreenGui.IgnoreGuiInset = true
ScreenGui.DisplayOrder = 10
ScreenGui.ResetOnSpawn = false

-- Buat frame sebagai latar belakang hitam


local blackFrame = Instance.new("Frame")
blackFrame.Size = UDim2.new(1, 0, 1, 0) -- Ukuran frame mengisi seluruh layar
blackFrame.BackgroundColor3 = Color3.new(0, 0, 0) -- Warna hitam
blackFrame.BackgroundTransparency = 0.5 -- Transparansi 0.5 (50% hitam)
blackFrame.Parent = ScreenGui

-- Buat tombol "Buy All Items"


local buyButton = Instance.new("TextButton")
buyButton.Text = "Buy All Items"
buyButton.Size = UDim2.new(0.2, 0, 0.1, 0)
buyButton.Position = UDim2.new(0.4, 0, 0.4, 0)
buyButton.BackgroundColor3 = Color3.new(1, 1, 1) -- Warna putih
buyButton.Parent = blackFrame

-- Fungsi untuk menjalankan skrip saat tombol diklik


local function buyAllItems()
-- Jalankan skrip lain di sini (contoh: pesan pop-up)
print("Script for Buy All Items executed!")
end

buyButton.MouseButton1Click:Connect(buyAllItems)

-- Fungsi untuk menggerakkan GUI (opsional)


local dragging = false
local dragInput, dragStart, startPos

local function updateInput(input)


local delta = input.Position - dragStart
ScreenGui.Enabled = true
ScreenGui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end

blackFrame.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = ScreenGui.Position

input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)

blackFrame.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)

You might also like