Professional Documents
Culture Documents
Candy Farm
Candy Farm
Candy Farm
local CandyTable = {}
for i,v in next,workspace:GetChildren() do
if v:IsA("MeshPart") and v.Name == "CandyCane" and not table.find(CandyTable,v)
then
table.insert(CandyTable,v)
end
end
Workspace.ChildAdded:Connect(function(Instance)
wait(.5)
if Instance:IsA("MeshPart") and Instance.Name == "CandyCane" and not
table.find(CandyTable,Instance) then
table.insert(CandyTable,Instance)
end
end)
local currentpos
task.spawn(function()
while true do
wait()
for current = 1,#CandyTable do
if CandyTable[current] and CandyTable[current].CFrame.Y < 200 then
local currentpos =
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
getgenv().changestate(game.Players.LocalPlayer.Character,true)
game.Players.LocalPlayer.Character.HumanoidRootPart.Anchored =
false
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame =
CandyTable[current].CFrame
task.wait(.2)
getgenv().changestate(game.Players.LocalPlayer.Character,false)
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame =
currentpos
if getgenv().IntegrateAutoStrats == true then
getgenv().output('Picked up Candy Cane!',Color3.fromRGB(255, 0,
0))
end