Created
April 2, 2025 07:22
-
-
Save bolahqt318207/c2efec2bb3e6078bee81258a9053e47c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not game:IsLoaded() then | |
game.Loaded:Wait() | |
end | |
local Players = game:GetService("Players") | |
local TeleportService = game:GetService("TeleportService") | |
local LocalPlayer = Players.LocalPlayer | |
-- Tạo GUI | |
local ScreenGui = Instance.new("ScreenGui") | |
ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") | |
local Frame = Instance.new("Frame") | |
Frame.Size = UDim2.new(0, 480, 0, 110) | |
Frame.Position = UDim2.new(0.4, -240, 0, 20) | |
Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) | |
Frame.BorderSizePixel = 2 | |
Frame.Parent = ScreenGui | |
-- Hiển thị số người trong server | |
local PlayerCountLabel = Instance.new("TextLabel") | |
PlayerCountLabel.Size = UDim2.new(0, 460, 0, 25) | |
PlayerCountLabel.Position = UDim2.new(0, 10, 0, 5) | |
PlayerCountLabel.Text = "Số người trong server: " .. #Players:GetPlayers() .. "/12" | |
PlayerCountLabel.TextColor3 = Color3.fromRGB(0, 255, 0) | |
PlayerCountLabel.TextScaled = true | |
PlayerCountLabel.BackgroundTransparency = 1 | |
PlayerCountLabel.Parent = Frame | |
-- Hiển thị tên của chính mình | |
local PlayerNameLabel = Instance.new("TextLabel") | |
PlayerNameLabel.Size = UDim2.new(0, 460, 0, 25) | |
PlayerNameLabel.Position = UDim2.new(0, 10, 0, 30) | |
PlayerNameLabel.Text = "Tên của bạn: " .. LocalPlayer.Name | |
PlayerNameLabel.TextColor3 = Color3.fromRGB(255, 255, 0) | |
PlayerNameLabel.TextScaled = true | |
PlayerNameLabel.BackgroundTransparency = 1 | |
PlayerNameLabel.Parent = Frame | |
local TextBox = Instance.new("TextBox") | |
TextBox.Size = UDim2.new(0, 220, 0, 45) | |
TextBox.Position = UDim2.new(0, 10, 0.5, 5) | |
TextBox.PlaceholderText = "Nhập JOB ID..." | |
TextBox.Text = "" | |
TextBox.BackgroundColor3 = Color3.fromRGB(200, 200, 200) | |
TextBox.TextSize = 18 | |
TextBox.Parent = Frame | |
local JoinButton = Instance.new("TextButton") | |
JoinButton.Size = UDim2.new(0, 100, 0, 45) | |
JoinButton.Position = UDim2.new(0, 240, 0.5, 5) | |
JoinButton.Text = "Tham gia" | |
JoinButton.TextScaled = true | |
JoinButton.TextColor3 = Color3.fromRGB(255, 255, 255) | |
JoinButton.BackgroundColor3 = Color3.fromRGB(0, 200, 0) | |
JoinButton.Parent = Frame | |
local CopyButton = Instance.new("TextButton") | |
CopyButton.Size = UDim2.new(0, 90, 0, 45) | |
CopyButton.Position = UDim2.new(0, 350, 0.5, 5) | |
CopyButton.Text = "Copy ID" | |
CopyButton.TextScaled = true | |
CopyButton.TextColor3 = Color3.fromRGB(255, 255, 255) | |
CopyButton.BackgroundColor3 = Color3.fromRGB(0, 100, 255) | |
CopyButton.Parent = Frame | |
-- Nút bật/tắt UI | |
local ToggleButton = Instance.new("TextButton") | |
ToggleButton.Size = UDim2.new(0, 40, 0, 40) | |
ToggleButton.Position = UDim2.new(1, -45, 0.5, -20) | |
ToggleButton.Text = "✖" | |
ToggleButton.TextSize = 18 | |
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) | |
ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) | |
ToggleButton.Parent = Frame | |
-- Cập nhật số người chơi trong server | |
local function updatePlayerCount() | |
PlayerCountLabel.Text = "Số người trong server: " .. #Players:GetPlayers() .. "/12" | |
end | |
Players.PlayerAdded:Connect(updatePlayerCount) | |
Players.PlayerRemoving:Connect(updatePlayerCount) | |
-- Xử lý khi nhấn nút tham gia | |
JoinButton.MouseButton1Click:Connect(function() | |
local jobId = TextBox.Text | |
if jobId ~= "" then | |
TeleportService:TeleportToPlaceInstance(game.PlaceId, jobId, LocalPlayer) | |
else | |
TextBox.PlaceholderText = "Nhập JOB ID trước!" | |
end | |
end) | |
-- Xử lý khi nhấn nút Copy | |
CopyButton.MouseButton1Click:Connect(function() | |
local jobId = game.JobId | |
if setclipboard then | |
setclipboard(jobId) | |
CopyButton.Text = "Đã Copy!" | |
wait(1) | |
CopyButton.Text = "Copy ID" | |
else | |
CopyButton.Text = "Không hỗ trợ!" | |
wait(1) | |
CopyButton.Text = "Copy ID" | |
end | |
end) | |
-- Xử lý khi nhấn nút bật/tắt UI | |
ToggleButton.MouseButton1Click:Connect(function() | |
Frame.Visible = false | |
-- Tạo nút mở lại UI | |
local OpenButton = Instance.new("TextButton") | |
OpenButton.Size = UDim2.new(0, 50, 0, 30) | |
OpenButton.Position = UDim2.new(0.4, -25, 0, 20) | |
OpenButton.Text = "📌" | |
OpenButton.TextSize = 20 | |
OpenButton.TextColor3 = Color3.fromRGB(255, 255, 255) | |
OpenButton.BackgroundColor3 = Color3.fromRGB(0, 200, 0) | |
OpenButton.Parent = ScreenGui | |
OpenButton.MouseButton1Click:Connect(function() | |
Frame.Visible = true | |
OpenButton:Destroy() | |
end) | |
end) | |
print("AutoExec script đã chạy thành công!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment