Im helping a friend to make some sort of tycoon game, there’s giraffes that work just like droppers, there’s a button called “Merge” which allows you to convert 4 giraffes with the same type into 1 better type.
But i have no idea on how can i get 4 giraffes, remove the 4 ones and replace them with a better tier one.
I was trying to find a way so the for _, v at the bottom is unfinished
local CurrentGiraffes = GetGiraffes() – This should return a table. –
local Table = {}
for _, Value in pairs(CurrentGiraffes) do
if Value.Name == "Giraffe" then
if Value:FindFirstChild("Tier") then
if Value.Tier.Value == 1 then
table.insert(Table, Value)
return
end
end
end
end
for _, v in pairs(Table) do
end
for _, Value in pairs(CurrentGiraffes) do
if Value.Name == "Giraffe" then
if Value:FindFirstChild("Tier") then
if Value.Tier.Value == 1 then
table.insert(Table, Value)
end
end
end
end
local Count = 0
for _, v in pairs(Table) do
local ChosenGiraffe = v
if Count ~= 5 then
Count = Count + 1
print(Count)
v:Destroy()
end
end