local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local rs = game:GetService("RunService")
local enabled = false
local connection
local function getTurkeys()
local folder = workspace:FindFirstChild("Turkeys")
if not folder then
return {}
end
local turkeys = {}
for _, obj in ipairs(folder:GetChildren()) do
if obj.Name == "Turkey" and obj:IsA("BasePart") then
table.insert(turkeys, obj)
end
end
return turkeys
end
local function startTeleportLoop()
if connection then return end
connection = rs.Heartbeat:Connect(function()
if not enabled then return end
local character = player.Character
if not character then return end
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then return end
local turkeys = getTurkeys()
if #turkeys == 0 then
return
end
for _, turkey in ipairs(turkeys) do
if enabled and turkey and turkey.Parent then
hrp.CFrame = turkey.CFrame + Vector3.new(0, 5, 0)
task.wait(0.3)
else
break
end
end
end)
end
local function stopTeleportLoop()
if connection then
connection:Disconnect()
connection = nil
end
end
uis.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.L then
enabled = not enabled
if enabled then
startTeleportLoop()
else
stopTeleportLoop()
end
end
end)
Comments
No comments yet
Be the first to share your thoughts!