I know the title is very confusing, but how can I get the number value that equals a string value in a table?
game:GetService("ReplicatedStorage").Remote.Sell.OnServerEvent:Connect(function(plr, item)
local items = {
["Iron Sword"] = 500,
["Iron Greatsword"] = 1000,
}
for i = 1,#items do
if item == items[i] then
plr.leaderstats.Gold.Value = plr.leaderstats.Gold.Value + items[i].Value
plr.Backpack:FindFirstChild(item):Destroy()
end
end
end)
