local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local player = Players.LocalPlayer
local function getCharacter()
return player.Character or player.CharacterAdded:Wait()
end
local function getHRP()
return getCharacter():WaitForChild("HumanoidRootPart")
end
local function getHumanoid()
return getCharacter():WaitForChild("Humanoid")
end
local autoTeleport = false
local autoThread = nil
local autoHitbox = nil
local function stopAuto()
autoTeleport = false
if autoThread then
task.cancel(autoThread)
autoThread = nil
end
end
local function startAuto(hitbox)
stopAuto()
autoTeleport = true
autoHitbox = hitbox
autoThread = task.spawn(function()
while autoTeleport do
local hrp = getHRP()
local humanoid = getHumanoid()
hrp.CFrame = hitbox.CFrame + Vector3.new(0, 3, 0)
local startTime = tick()
while autoTeleport and tick() - startTime < 20 do
if humanoid.FloorMaterial ~= Enum.Material.Air then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
task.wait(0.4)
end
end
end)
end
local gui = Instance.new("ScreenGui")
gui.Name = "HouseTeleportGui"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")
local frame = Instance.new("Frame")
frame.Size = UDim2.fromOffset(260, 60)
frame.Position = UDim2.fromOffset(30, 200)
frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
frame.BorderSizePixel = 0
frame.Parent = gui
frame.AutomaticSize = Enum.AutomaticSize.Y
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12)
Instance.new("UIStroke", frame).Color = Color3.fromRGB(60, 60, 60)
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, 0, 0, 40)
title.BackgroundTransparency = 1
title.Text = "🎄 Present AutoFarm"
title.TextColor3 = Color3.fromRGB(235, 235, 235)
title.Font = Enum.Font.GothamBold
title.TextSize = 16
title.Parent = frame
local container = Instance.new("Frame")
container.Size = UDim2.new(1, -16, 1, -50)
container.Position = UDim2.fromOffset(8, 44)
container.BackgroundTransparency = 1
container.Parent = frame
local layout = Instance.new("UIListLayout", container)
layout.Padding = UDim.new(0, 6)
layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
frame.Size = UDim2.fromOffset(260, layout.AbsoluteContentSize.Y + 60)
end)
do
local dragging, dragStart, startPos
title.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
dragStart = input.Position
startPos = frame.Position
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Position - dragStart
frame.Position = UDim2.fromOffset(
startPos.X.Offset + delta.X,
startPos.Y.Offset + delta.Y
)
end
end)
end
local function createHouseRow(name, hitbox)
local row = Instance.new("Frame")
row.Size = UDim2.new(1, 0, 0, 36)
row.BackgroundTransparency = 1
row.Parent = container
row.AutomaticSize = Enum.AutomaticSize.Y
local houseLabel = Instance.new("TextButton")
houseLabel.Size = UDim2.new(0.6, -4, 1, 0)
houseLabel.AnchorPoint = Vector2.new(0.5, 0.5)
houseLabel.Position = UDim2.new(0.3, 0, 0.5, 0)
houseLabel.Text = name
houseLabel.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
houseLabel.TextColor3 = Color3.fromRGB(230, 230, 230)
houseLabel.Font = Enum.Font.GothamBold
houseLabel.TextSize = 14
houseLabel.Parent = row
Instance.new("UICorner", houseLabel).CornerRadius = UDim.new(0, 8)
local auto = Instance.new("TextButton")
auto.Size = UDim2.new(0.4, -4, 1, 0)
auto.AnchorPoint = Vector2.new(0.5, 0.5)
auto.Position = UDim2.new(0.8, 0, 0.5, 0)
auto.Text = "AUTO: OFF"
auto.BackgroundColor3 = Color3.fromRGB(45, 25, 25)
auto.TextColor3 = Color3.fromRGB(255, 200, 200)
auto.Font = Enum.Font.GothamBold
auto.TextSize = 14
auto.Parent = row
Instance.new("UICorner", auto).CornerRadius = UDim.new(0, 8)
houseLabel.MouseButton1Click:Connect(function()
stopAuto()
local hrp = getHRP()
hrp.CFrame = hitbox.CFrame + Vector3.new(0, 3, 0)
end)
auto.MouseButton1Click:Connect(function()
if autoTeleport and autoHitbox == hitbox then
stopAuto()
auto.Text = "AUTO: OFF"
auto.BackgroundColor3 = Color3.fromRGB(45, 25, 25)
auto.TextColor3 = Color3.fromRGB(255, 200, 200)
else
startAuto(hitbox)
auto.Text = "AUTO: ON"
auto.BackgroundColor3 = Color3.fromRGB(25, 45, 25)
auto.TextColor3 = Color3.fromRGB(230, 230, 230)
end
local tweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local tweenUp = TweenService:Create(auto, tweenInfo, {Size = auto.Size + UDim2.new(0, 4, 0, 4)})
local tweenDown = TweenService:Create(auto, tweenInfo, {Size = auto.Size})
tweenUp:Play()
tweenUp.Completed:Connect(function()
tweenDown:Play()
end)
end)
end
task.spawn(function()
local houses = workspace:WaitForChild("Christmas_Houses", 10)
if not houses then return end
for i, house in ipairs(houses:GetChildren()) do
local hitbox = house:FindFirstChild("Hitbox", true)
if hitbox and hitbox:IsA("BasePart") then
local houseLabelName = "House " .. i
createHouseRow(houseLabelName, hitbox)
end
end
end)
Comments
No comments yet
Be the first to share your thoughts!