So basically I’ve seen games where you click a button etc whatever
and it puts said items into a container and puts them into a sorted area
Currently I’m just looking for the most efficient way to do that, the way I thought out initially was to have Nodes in place that are used for CFrame
This system I currently have works although I scripted a while ago
I just want to know if this is how people actually do it or if there’s a more efficient/Simpler way
local values = script.Parent.Parent.Parent.Values
local Nodes = values.Nodes:GetChildren()
local CanStorage = values.CanObjects
local Can = game.ReplicatedStorage.Items.Can
script.Parent.Triggered:Connect(function(player)
if player.Backpack:FindFirstChild("Can") then
for _,v in pairs(player.Backpack:GetChildren()) do
if v.Name == "Can" then
v:Destroy()
for _, g in pairs(Nodes) do
if g.Taken.Value ~= true then
local NewCan = Can:Clone()
NewCan.Parent = CanStorage
NewCan.CFrame = g.CFrame
g.Taken.Value = true
break
end
end
end
end
end
end)
Here’s the script, not my proudest work but it’s an example
Each node has a value attached to check if it’s being used or not