local Slots =
{
["One"] = "one";
["Two"] = "two";
["Three"] = "three";
}
local UserInput = game:GetService("UserInputService")
local LocalPlayer = game.Players.LocalPlayer
local BackPack = LocalPlayer.Backpack
function SetupInventory()
for i, v in pairs(BackPack:GetChildren()) do
Slots[i] = v
print(Slots[i]) -- This is displaying the newer version correctly
end
end
function SwitchSlot(Key)
local KeySlot = tostring(Key.Name)
print(Slots[KeySlot]) -- This shows a older version of the slot table for some reason
end
SetupInventory()
UserInput.InputBegan:Connect(SwitchSlot)
COMMUNITY QUESTION
Why wont this table update in the other part of this script?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.
