-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrop.lua
61 lines (55 loc) · 1.56 KB
/
drop.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-- Function to equip a fruit
local function equipFruit(player, fruitName)
-- Check if the item exists in your inventory
if player.Backpack:FindFirstChild(fruitName) then
local tool = player.Backpack[fruitName]
-- Equip the item
tool.Parent = player.Character
tool.Grip = CFrame.new(Vector3.new(), Vector3.new(0, 0, 0)) -- You might need to adjust this grip position
else
warn("Item not found in inventory.")
end
end
-- Function to drop a fruit
local function dropFruit(player, fruitName)
-- Check if the fruit is currently equipped
local equippedFruit = player.Character:FindFirstChild(fruitName)
if equippedFruit then
-- Drop the fruit
local args = {
[1] = "Drop"
}
equippedFruit.EatRemote:InvokeServer(unpack(args))
else
warn("Fruit not currently equipped.")
end
end
-- List of fruit names to equip and drop
local fruitsToEquipAndDrop = {
"Kilo Fruit",
"Spin Fruit",
"Chop Fruit",
"Spring Fruit",
"Bomb Fruit",
"Smoke Fruit",
"Spike Fruit",
"Flame Fruit",
"Falcon Fruit",
"Ice Fruit",
"Sand Fruit",
"Dark Fruit",
"Revive Fruit",
"Diamond Fruit",
"Light Fruit",
"Rubber Fruit",
"Barrier Fruit",
"Magma Fruit"
}
-- Equip all fruits first
for _, fruitName in ipairs(fruitsToEquipAndDrop) do
equipFruit(game.Players.LocalPlayer, fruitName)
end
-- Drop all fruits one by one
for _, fruitName in ipairs(fruitsToEquipAndDrop) do
dropFruit(game.Players.LocalPlayer, fruitName)
end