-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuantapcodegag
More file actions
133 lines (119 loc) · 4.15 KB
/
Copy pathQuantapcodegag
File metadata and controls
133 lines (119 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
-- 🌹 Quantapcode Hub - Pet Control 🌹
local Players = game:GetService("Players")
local lp = Players.LocalPlayer
-- ScreenGui chính
local gui = Instance.new("ScreenGui", lp:WaitForChild("PlayerGui"))
gui.Name = "QuantapcodePetHub"
-- Main Frame
local main = Instance.new("Frame", gui)
main.Size = UDim2.new(0, 400, 0, 250)
main.Position = UDim2.new(0.5, -200, 0.5, -125)
main.BackgroundColor3 = Color3.fromRGB(25,25,25)
main.Active = true
main.Draggable = true
main.Visible = false
Instance.new("UICorner", main).CornerRadius = UDim.new(0,15)
-- Title
local title = Instance.new("TextLabel", main)
title.Size = UDim2.new(1,0,0,50)
title.Text = "🌹 Quantapcode - Pet Control 🌹"
title.Font = Enum.Font.GothamBold
title.TextSize = 20
title.TextColor3 = Color3.fromRGB(255,255,255)
title.BackgroundColor3 = Color3.fromRGB(50,50,50)
title.BorderSizePixel = 0
-- Content Frame
local content = Instance.new("Frame", main)
content.Size = UDim2.new(1,0,1,-50)
content.Position = UDim2.new(0,0,0,50)
content.BackgroundColor3 = Color3.fromRGB(45,45,45)
-- Notify
local function notify(msg)
game.StarterGui:SetCore("SendNotification", {
Title = "🌹 Quantapcode",
Text = msg,
Duration = 3
})
end
-- Hàm tìm pet
local function getPet()
for _, v in pairs(workspace:GetDescendants()) do
if v:IsA("Model") and v:FindFirstChild("HumanoidRootPart") then
return v
end
end
return nil
end
-- Hàm tìm vị trí giữa vườn
local function getMiddlePos()
-- Ưu tiên tìm part có tên chứa "Center" hoặc "Middle"
for _, v in pairs(workspace:GetDescendants()) do
if v:IsA("BasePart") and (string.find(v.Name:lower(), "center") or string.find(v.Name:lower(), "middle")) then
return v.Position + Vector3.new(0, 5, 0)
end
end
-- Nếu không có, lấy camera làm mốc
if workspace.CurrentCamera then
return workspace.CurrentCamera.CFrame.Position + Vector3.new(0, 5, 0)
end
-- Fallback
return Vector3.new(0, 5, 0)
end
-- Giữ pet ở giữa
local keepMiddle = false
local btnMiddle = Instance.new("TextButton", content)
btnMiddle.Size = UDim2.new(1,-20,0,50)
btnMiddle.Position = UDim2.new(0,10,0,10)
btnMiddle.Text = "🌹 Giữ pet ở giữa"
btnMiddle.Font = Enum.Font.GothamBold
btnMiddle.TextSize = 18
btnMiddle.TextColor3 = Color3.fromRGB(255,255,255)
btnMiddle.BackgroundColor3 = Color3.fromRGB(80,80,80)
Instance.new("UICorner", btnMiddle).CornerRadius = UDim.new(0,10)
btnMiddle.MouseButton1Click:Connect(function()
keepMiddle = not keepMiddle
if keepMiddle then
btnMiddle.Text = "❌ Tắt giữ pet ở giữa"
notify("✅ Đang giữ pet ở giữa vườn")
task.spawn(function()
while keepMiddle do
local pet = getPet()
if pet and pet:FindFirstChild("HumanoidRootPart") then
pet:MoveTo(getMiddlePos())
end
task.wait(0.5)
end
end)
else
btnMiddle.Text = "🌹 Giữ pet ở giữa"
notify("⚠️ Đã tắt giữ pet")
end
end)
-- Cho pet tự do
local btnFree = Instance.new("TextButton", content)
btnFree.Size = UDim2.new(1,-20,0,50)
btnFree.Position = UDim2.new(0,10,0,70)
btnFree.Text = "🌹 Cho pet tự do"
btnFree.Font = Enum.Font.GothamBold
btnFree.TextSize = 18
btnFree.TextColor3 = Color3.fromRGB(255,255,255)
btnFree.BackgroundColor3 = Color3.fromRGB(80,80,80)
Instance.new("UICorner", btnFree).CornerRadius = UDim.new(0,10)
btnFree.MouseButton1Click:Connect(function()
keepMiddle = false
btnMiddle.Text = "🌹 Giữ pet ở giữa"
notify("✅ Pet đã được tự do chạy")
end)
-- Toggle Icon 🌹
local toggleBtn = Instance.new("TextButton", gui)
toggleBtn.Size = UDim2.new(0,50,0,50)
toggleBtn.Position = UDim2.new(0,10,0,10)
toggleBtn.Text = "🌹"
toggleBtn.Font = Enum.Font.GothamBold
toggleBtn.TextSize = 28
toggleBtn.TextColor3 = Color3.fromRGB(255,255,255)
toggleBtn.BackgroundColor3 = Color3.fromRGB(50,50,50)
Instance.new("UICorner", toggleBtn).CornerRadius = UDim.new(0,10)
toggleBtn.MouseButton1Click:Connect(function()
main.Visible = not main.Visible
end)