Basically, I’ve made a script that transfers the backpack’s contents and then re-transfers it. But for some reason it doesn’t work, I believe the problem relies within the table.
Script:
local ToolOrder = {
script.Parent.Slots.A.Value, script.Parent.Slots.B.Value, script.Parent.Slots.C.Value, script.Parent.Slots.D.Value, script.Parent.Slots.E.Value,
script.Parent.Slots.F.Value, script.Parent.Slots.G.Value, script.Parent.Slots.H.Value, script.Parent.Slots.J.Value
}
local function organize()
for i,v in ipairs(ToolOrder) do
v.Parent = script.Parent.ToolHolder
end
for i,v in ipairs(ToolOrder) do
v.Parent = player.Backpack
end
end
Can you give us more detail, from what i can tell it seems you’re trying to make a save system for the players backpack and you’re re-transferring this data in ToolOrder to organise it. But please do correct me if I’m wrong so I can help you.
P.S Sorry but can you also tell me where you scripts located so I can just better understand the issue.
The scripts outputs nothing for some reason, I’m 99% the problem is with the table though.
(maybe it’s because I’m transfering tools through a local script?)
Actually that was a concern I had when you showed me your UI tree. Maybe try to make it server-side. So that the script fires a remote event that sends credentials of the user, such as their name. I would then make the server transfer anything.
From what I’m seeing it seems the script runs but for some reason the server is denying the change? That’s what I’m inferring.
Right, still not working correctly, here’s the new script:
for i,tool in ipairs(Ordea) do
if i == 1 then
script.Parent.Slots.A.Value = tool
elseif i == 2 then
script.Parent.Slots.B.Value = tool
elseif i == 3 then
script.Parent.Slots.C.Value = tool
elseif i == 4 then
script.Parent.Slots.D.Value = tool
elseif i == 5 then
script.Parent.Slots.E.Value = tool
elseif i == 6 then
script.Parent.Slots.F.Value = tool
elseif i == 7 then
script.Parent.Slots.G.Value = tool
elseif i == 8 then
script.Parent.Slots.H.Value = tool
elseif i == 9 then
script.Parent.Slots.J.Value = tool
end
end
for i,v in ipairs(ToolOrder) do
v.Parent = script.Parent.ToolHolder
end
for i,v in ipairs(ToolOrder) do
v.Parent = player.Backpack
end
I think I see something, call me out if I’m wrong but everything ToolOrder is set to “.Value” your not actually referring to the object. When you do…
for i,v in ipairs(ToolOrder) do
v.Parent = script.Parent.ToolHolder
end
v.Parent
Is not the object your actually referring to the Values Parent in this case.
I cant give an example because you have structured the table wrong as you speculated so don’t refer to the items as Value but the object itself