RS = game:GetService("ReplicatedStorage")
BuyItem = RS.Events.BuyItem
items = {
["ShopItems"] = "ClassicSword","Axe","Pickaxe"
}
BuyItem.OnServerEvent:connect(function(player,cost,item)
--subtracting money from player
player.Money.Value = player.Money.Value -cost
--giving them the item
game.ServerStorage[items.ShopItems[item]]:Clone().Parent = player.Backpack
end)
So I'm trying to get the item the player is trying to buy and give it to them. I am storing the item names in a table so it's easier. I failed at doing it and I really don't know how to do this. I want to get the item from the table and search for it in serverstorage and give it to the player...

2 comments
You would have to loop through the table to find it, but imo it seems kind of unnessecary unless you intend to add values to that table like cost/damage/etc...is there a reason you can't just search serverstorage directly via FindFirstChild?
Yeah, I realised that.