-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUltimateGUI.lua
More file actions
336 lines (296 loc) · 10.3 KB
/
UltimateGUI.lua
File metadata and controls
336 lines (296 loc) · 10.3 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local workspace = game:GetService("Workspace")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
gui.ResetOnSpawn = false
-- حقوق الشيخ + مربع المفتاح --
local rightsFrame = Instance.new("Frame", gui)
rightsFrame.Position = UDim2.new(0, 10, 0, 10)
rightsFrame.Size = UDim2.new(0, 220, 0, 120)
rightsFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
rightsFrame.BackgroundTransparency = 0.3
rightsFrame.BorderSizePixel = 0
rightsFrame.Active = true
rightsFrame.Draggable = true
local rightsLabel = Instance.new("TextLabel", rightsFrame)
rightsLabel.Size = UDim2.new(1, 0, 0, 30)
rightsLabel.Position = UDim2.new(0, 0, 0, 0)
rightsLabel.Text = "حقوق الشيخ"
rightsLabel.TextColor3 = Color3.new(1,1,1)
rightsLabel.BackgroundTransparency = 1
rightsLabel.Font = Enum.Font.SourceSansBold
rightsLabel.TextSize = 20
local keyInput = Instance.new("TextBox", rightsFrame)
keyInput.Size = UDim2.new(1, -20, 0, 30)
keyInput.Position = UDim2.new(0, 10, 0, 40)
keyInput.PlaceholderText = "اكتب المفتاح هنا"
keyInput.Text = ""
keyInput.ClearTextOnFocus = true
keyInput.TextColor3 = Color3.new(1,1,1)
keyInput.BackgroundColor3 = Color3.fromRGB(40,40,40)
keyInput.Font = Enum.Font.SourceSans
keyInput.TextSize = 18
local discordBtn = Instance.new("TextButton", rightsFrame)
discordBtn.Size = UDim2.new(1, -20, 0, 30)
discordBtn.Position = UDim2.new(0, 10, 0, 80)
discordBtn.Text = "تعال ديسكورد للمفتاح"
discordBtn.Font = Enum.Font.SourceSansBold
discordBtn.TextSize = 18
discordBtn.TextColor3 = Color3.new(1,1,1)
discordBtn.BackgroundColor3 = Color3.fromRGB(50,50,50)
discordBtn.MouseButton1Click:Connect(function()
setclipboard("https://discord.gg/PBTrMHVq")
discordBtn.Text = "تم النسخ ✅"
wait(2)
discordBtn.Text = "تعال ديسكورد للمفتاح"
end)
-- الإطار الرئيسي للواجهة
local mainFrame = Instance.new("Frame", gui)
mainFrame.Position = UDim2.new(0, 10, 0.5, -150)
mainFrame.Size = UDim2.new(0, 240, 0, 360)
mainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
mainFrame.BackgroundTransparency = 0.3
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Draggable = true
mainFrame.Visible = false
-- زر إظهار / إخفاء الواجهة
local toggleBtn = Instance.new("TextButton", gui)
toggleBtn.Size = UDim2.new(0, 120, 0, 40)
toggleBtn.Position = UDim2.new(0, 10, 0, 140)
toggleBtn.BackgroundColor3 = Color3.fromRGB(20,20,20)
toggleBtn.BackgroundTransparency = 0.3
toggleBtn.TextColor3 = Color3.new(1,1,1)
toggleBtn.Text = "إظهار / إخفاء الواجهة"
toggleBtn.Font = Enum.Font.SourceSansBold
toggleBtn.TextSize = 18
toggleBtn.MouseButton1Click:Connect(function()
mainFrame.Visible = not mainFrame.Visible
end)
-- تزيين الزوايا 🔲
for _, pos in ipairs({
Vector2.new(0, 0),
Vector2.new(230, 0),
Vector2.new(0, 350),
Vector2.new(230, 350)
}) do
local redDot = Instance.new("TextLabel", mainFrame)
redDot.Position = UDim2.new(0, pos.X, 0, pos.Y)
redDot.Size = UDim2.new(0, 10, 0, 10)
redDot.Text = "🔲"
redDot.BackgroundTransparency = 1
redDot.TextScaled = true
end
-- دالة إنشاء زر بحجم متوسط (3x3 ترتيب)
local function createBtn(text, row, col)
local btnSize = UDim2.new(0, 70, 0, 70)
local padding = 5
local xPos = (col - 1) * (70 + padding)
local yPos = (row - 1) * (70 + padding) + 25
local btn = Instance.new("TextButton", mainFrame)
btn.Size = btnSize
btn.Position = UDim2.new(0, xPos, 0, yPos)
btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
btn.TextColor3 = Color3.new(1, 1, 1)
btn.Font = Enum.Font.SourceSansBold
btn.TextSize = 20
btn.Text = text
return btn
end
-- المتغيرات المشتركة
local dead = false
local flying = false
local flyConn
local savedPos
local walkSquare = false
local walkSquareConn
local chasing = false
local chaseConn
local currentTarget = nil
local antiTouchEnabled = false -- مش مستخدم الآن لكن خليته جاهز
-- متغيرات الطيران fling
local flinging = false
local flingConn
local flingStartPos
-- سرعة الطيران fling
local flingSpeed = 80
-- متغيرات Fly عادي
local flySpeed = 40
local function updateFlyBtnText()
flyBtn.Text = "Fly\n("..flySpeed..")"
end
-- إنشاء الأزرار 3x3
-- الصف 1: Fly + -
local flyBtn = createBtn("Fly\n("..flySpeed..")", 1, 1)
local plusBtn = createBtn("+", 1, 2)
local minusBtn = createBtn("-", 1, 3)
-- الصف 2: موت - قرب لاعب - مربع
local deadBtn = createBtn("موت", 2, 1)
local teleportCloseBtn = createBtn("قرب لاعب", 2, 2)
local squareBtn = createBtn("⬜", 2, 3)
-- الصف 3: مطارده - Teleport - tp
local chaseBtn = createBtn("مطارده", 3, 1)
local teleportSaveBtn = createBtn("Teleport", 3, 2)
local tpBtn = createBtn("tp", 3, 3)
-- الصف 4: ⬆️ - Speed - تطيير
local jumpBtn = createBtn("⬆️", 4, 1)
local speedBtn = createBtn("Speed", 4, 2)
local flingBtn = createBtn("تطيير", 4, 3)
-- وظائف الأزرار:
-- 1. موت
deadBtn.MouseButton1Click:Connect(function()
local hum = char:FindFirstChildOfClass("Humanoid")
if not hum then return end
dead = not dead
if dead then
hum:ChangeState(Enum.HumanoidStateType.Physics)
for _, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") then
v.CanCollide = false
v.Anchored = false
end
end
hrp.CFrame = hrp.CFrame * CFrame.Angles(math.rad(90), 0, 0)
hrp.Velocity = Vector3.new(0, -50, 0)
else
hum:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end)
-- 2. قرب لاعب (Teleport خلف أقرب لاعب)
teleportCloseBtn.MouseButton1Click:Connect(function()
local closestPlayer = nil
local closestDistance = math.huge
local myPos = hrp.Position
for _, otherPlayer in pairs(Players:GetPlayers()) do
if otherPlayer ~= player and otherPlayer.Character and otherPlayer.Character:FindFirstChild("HumanoidRootPart") then
local otherPos = otherPlayer.Character.HumanoidRootPart.Position
local dist = (otherPos - myPos).Magnitude
if dist < closestDistance then
closestDistance = dist
closestPlayer = otherPlayer
end
end
end
if closestPlayer then
local targetHRP = closestPlayer.Character.HumanoidRootPart
local backPosition = targetHRP.CFrame * CFrame.new(0, 0, 2)
hrp.CFrame = backPosition
end
end)
-- 3. مربع (يمشي في مربع 40 وحدة باتجاهات 4)
squareBtn.MouseButton1Click:Connect(function()
walkSquare = not walkSquare
if walkSquare then
local directions = {
Vector3.new(0, 0, -1),
Vector3.new(1, 0, 0),
Vector3.new(0, 0, 1),
Vector3.new(-1, 0, 0),
}
local index = 1
if walkSquareConn then walkSquareConn:Disconnect() end
walkSquareConn = RunService.Heartbeat:Connect(function()
if not walkSquare then return end
local dir = directions[index]
hrp.Velocity = dir * 40
end)
spawn(function()
while walkSquare do
wait(1)
index = index + 1
if index > #directions then index = 1 end
end
end)
else
if walkSquareConn then walkSquareConn:Disconnect() end
hrp.Velocity = Vector3.zero
end
end)
-- 4. مطارده (يتتبع أقرب لاعب)
local function findClosestPlayer(exclude)
local closestPlayer = nil
local closestDistance = math.huge
local myPos = hrp.Position
for _, otherPlayer in pairs(Players:GetPlayers()) do
if otherPlayer ~= player and otherPlayer ~= exclude and otherPlayer.Character and otherPlayer.Character:FindFirstChild("HumanoidRootPart") then
local otherPos = otherPlayer.Character.HumanoidRootPart.Position
local dist = (otherPos - myPos).Magnitude
if dist < closestDistance then
closestDistance = dist
closestPlayer = otherPlayer
end
end
end
return closestPlayer
end
chaseBtn.MouseButton1Click:Connect(function()
chasing = not chasing
if chasing then
currentTarget = nil
local lastReachTime = tick()
if chaseConn then chaseConn:Disconnect() end
chaseConn = RunService.Heartbeat:Connect(function()
if not currentTarget or not currentTarget.Character or not currentTarget.Character:FindFirstChild("HumanoidRootPart") then
currentTarget = findClosestPlayer(currentTarget)
lastReachTime = tick()
end
if currentTarget and currentTarget.Character and currentTarget.Character:FindFirstChild("HumanoidRootPart") then
local targetHRP = currentTarget.Character.HumanoidRootPart
local targetPos = targetHRP.Position - Vector3.new(0, targetHRP.Size.Y / 2 or 2, 0)
local direction = (targetPos - hrp.Position)
local dist = direction.Magnitude
if dist < 2 then
currentTarget = findClosestPlayer(currentTarget)
lastReachTime = tick()
else
local dirNorm = direction.Unit
-- تفادي الجدران
local rayOrigin = hrp.Position
local rayDir = dirNorm * 3
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {char}
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = workspace:Raycast(rayOrigin, rayDir, raycastParams)
if raycastResult and raycastResult.Instance and raycastResult.Instance.CanCollide then
-- اتجاه بديل (يسار)
local leftDir = CFrame.new().LookVector:Cross(Vector3.new(0,1,0))
hrp.Velocity = leftDir * 40
else
hrp.Velocity = dirNorm * 40
end
if tick() - lastReachTime > 1.5 then
currentTarget = findClosestPlayer(currentTarget)
lastReachTime = tick()
end
end
else
hrp.Velocity = Vector3.zero
end
end)
else
if chaseConn then chaseConn:Disconnect() end
hrp.Velocity = Vector3.zero
currentTarget = nil
end
end)
-- 5. حفظ الموقع (Teleport)
teleportSaveBtn.MouseButton1Click:Connect(function()
savedPos = hrp.Position
end)
-- 6. الذهاب للموقع المحفوظ (tp)
tpBtn.MouseButton1Click:Connect(function()
if savedPos then
hrp.CFrame = CFrame.new(savedPos)
end
end)
-- 7. القفز عالي (⬆️)
jumpBtn.MouseButton1Click:Connect(function()
hrp.CFrame = hrp.CFrame + Vector3.new(0, 120, 0)
end)
-- 8. سرعة المشي (Speed)
speedBtn.MouseButton1Click:Connect(function()
local hum = char:F