Im trying to do a buy event from my shop but i keep getting an error when i try to add an item from data (Name of my leaderstat) to the player. If you could help me, i would apprciate it.
Here is the error: ServerScriptService.Buy/Sell Manager:43: attempt to perform arithmetic (add) on nil and string - Server - Buy/Sell Manager:43.
here is the script:
BuyShopEvent.OnServerEvent:Connect(function(player, ShopItemPrice, ItemToGet, QuantityToGet)
if player.Data.Coins.Value >= ShopItemPrice.Value then
player.Data.Coins.Value -= ShopItemPrice.Value
player.Data[ItemToGet].Value = ItemToGet.Value +QuantityToGet
end
end)
i didnt work, im getting this error: ServerScriptService.Buy/Sell Manager:43: attempt to perform arithmetic (add) on string - Server - Buy/Sell Manager:43