local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local VirtualInputManager = game:GetService("VirtualInputManager")
local localPlayer = Players.LocalPlayer
local firefliesFolder = Workspace.WorldFireflies
local rarityOrder = {
["Rainbow"] = 1,
["Purple"] = 2,
["Golden"] = 3
}
local function getPriority(objName)
for keyword, priority in pairs(rarityOrder) do
if string.find(objName, keyword) then
return priority
end
end
return nil
end
local function getTargetFireflies()
local list = {}
for _, obj in ipairs(firefliesFolder:GetChildren()) do
local priority = getPriority(obj.Name)
if priority then
local prompt = obj:FindFirstChildOfClass("ProximityPrompt") or obj:GetComponentInChildren("ProximityPrompt")
if not prompt then
for _, child in ipairs(obj:GetDescendants()) do
if child:IsA("ProximityPrompt") then
prompt = child
break
end
end
end
local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart")
if not part and prompt then
part = prompt.Parent
end
if prompt and part then
table.insert(list, {object = part, prompt = prompt, priority = priority, rawObject = obj})
end
end
end
table.sort(list, function(a, b)
return a.priority < b.priority
end)
return list
end
-- inf loop
task.spawn(function()
print("sorry mom i like boys..")
while true do
local character = localPlayer.Character
local rootPart = character and character:FindFirstChild("HumanoidRootPart")
if rootPart then
local targets = getTargetFireflies()
if #targets > 0 then
for _, target in ipairs(targets) do
local rawObject = target.rawObject
local prompt = target.prompt
if target.object and prompt and rawObject:IsDescendantOf(firefliesFolder) then
local keyCode = prompt.KeyboardKeyCode
prompt.HoldDuration = 0
while rawObject:IsDescendantOf(firefliesFolder) and rawObject.Parent ~= nil do
rootPart.Velocity = Vector3.zero
rootPart.CFrame = target.object.CFrame + Vector3.new(0, 1, 0)
VirtualInputManager:SendKeyEvent(true, keyCode, false, game)
task.wait(0.02)
VirtualInputManager:SendKeyEvent(false, keyCode, false, game)
task.wait(0.03)
end
end
end
end
end
task.wait(0.1)
end
end)Auto Collect Fireflys For Care For Cats game.
free src
no ui
inf loop
and i like boys
No comments yet. Be the first to comment!
1local Players = game:GetService("Players")
2local Workspace = game:GetService("Workspace")
3local VirtualInputManager = game:GetService("VirtualInputManager")
4
5local localPlayer = Players.LocalPlayer
6local firefliesFolder = Workspace.WorldFireflies
7
8local rarityOrder = {
9 ["Rainbow"] = 1,
10 ["Purple"] = 2,
11 ["Golden"] = 3
12}
13
14local function getPriority(objName)
15 for keyword, priority in pairs(rarityOrder) do
16 if string.find(objName, keyword) then
17 return priority
18 end
19 end
20 return nil
21end
22
23local function getTargetFireflies()
24 local list = {}
25 for _, obj in ipairs(firefliesFolder:GetChildren()) do
26 local priority = getPriority(obj.Name)
27 if priority then
28 local prompt = obj:FindFirstChildOfClass("ProximityPrompt") or obj:GetComponentInChildren("ProximityPrompt")
29 if not prompt then
30 for _, child in ipairs(obj:GetDescendants()) do
31 if child:IsA("ProximityPrompt") then
32 prompt = child
33 break
34 end
35 end
36 end
37
38 local part = obj:IsA("BasePart") and obj or obj:FindFirstChildWhichIsA("BasePart")
39 if not part and prompt then
40 part = prompt.Parent
41 end
42
43 if prompt and part then
44 table.insert(list, {object = part, prompt = prompt, priority = priority, rawObject = obj})
45 end
46 end
47 end
48
49 table.sort(list, function(a, b)
50 return a.priority < b.priority
51 end)
52
53 return list
54end
55
56-- inf loop
57task.spawn(function()
58 print("sorry mom i like boys..")
59
60 while true do
61 local character = localPlayer.Character
62 local rootPart = character and character:FindFirstChild("HumanoidRootPart")
63
64 if rootPart then
65 local targets = getTargetFireflies()
66
67 if #targets > 0 then
68 for _, target in ipairs(targets) do
69 local rawObject = target.rawObject
70 local prompt = target.prompt
71
72 if target.object and prompt and rawObject:IsDescendantOf(firefliesFolder) then
73 local keyCode = prompt.KeyboardKeyCode
74 prompt.HoldDuration = 0
75
76 while rawObject:IsDescendantOf(firefliesFolder) and rawObject.Parent ~= nil do
77 rootPart.Velocity = Vector3.zero
78 rootPart.CFrame = target.object.CFrame + Vector3.new(0, 1, 0)
79
80 VirtualInputManager:SendKeyEvent(true, keyCode, false, game)
81 task.wait(0.02)
82 VirtualInputManager:SendKeyEvent(false, keyCode, false, game)
83
84 task.wait(0.03)
85 end
86 end
87 end
88 end
89 end
90 task.wait(0.1)
91 end
92end)