local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local isAutoSpamAll = false
local spamDelay = 0.1 -- ความเร็วในการเปลี่ยนเป้าหมาย (0.1 คือเร็วมาก)
-- ฟังก์ชันดึงรายชื่อผู้เล่นคนอื่นทุกคนในแมพ
local function getAllOtherPlayers()
local otherPlayers = {}
for _, v in pairs(Players:GetPlayers()) do
if v ~= player and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
local humanoid = v.Character:FindFirstChild("Humanoid")
if humanoid and humanoid.Health > 0 then
table.insert(otherPlayers, v.Character.HumanoidRootPart)
end
end
end
return otherPlayers
end
-- Loop ระบบวาร์ปทั่วแมพ
task.spawn(function()
while true do
if isAutoSpamAll then
local targets = getAllOtherPlayers()
if #targets > 0 then
-- สุ่มเลือก 1 คนจากทั้งเซิร์ฟเวอร์
local randomTarget = targets[math.random(1, #targets)]
local myChar = player.Character
local myRoot = myChar and myChar:FindFirstChild("HumanoidRootPart")
if myRoot and randomTarget then
-- สุ่มตำแหน่งรอบตัวเป้าหมาย (หน้า/หลัง/ซ้าย/ขวา)
local offsets = {
CFrame.new(0, 0, 4), CFrame.new(0, 0, -4),
CFrame.new(4, 0, 0), CFrame.new(-4, 0, 0)
}
local randomOffset = offsets[math.random(1, #offsets)]
-- วาร์ปไปหาและหันหน้ามองเป้าหมาย
myRoot.CFrame = CFrame.lookAt((randomTarget.CFrame * randomOffset).Position, randomTarget.Position)
end
end
end
task.wait(spamDelay)
end
end)
-- กด E เพื่อเปิด/ปิดโหมดวาร์ปหาทุกคน
UserInputService.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.E then
isAutoSpamAll = not isAutoSpamAll
if isAutoSpamAll then
print("โหมดเกรียนทั้งแมพ: ON")
else
print("โหมดเกรียนทั้งแมพ: OFF")
end
end
end)
Keyless
Keyless
Keyless