Ok, so here a problem Here script. This script for shop system. When player clicking button with scirpt = adding item from library of itemids (ServerStorage) with amount item that player wanted. Technically this script adding intvalue with name that is itemid, value is amount items, into folder that setuped by special script. Anyone can help with this? Here scripts, if you need. This its button that adding item
local object = game.ServerStorage
local localplayer = game.Players.LocalPlayer
local folder = localplayer.Items
script.Parent.Parent.TextButton.MouseButton1Down:connect(function()
for i, items in pairs(object:GetChildren()) do
local addeditem = Instance.new("IntValue")
addeditem.Name = items[1].Value
addeditem.Value = addeditem.Value + 1
addeditem.parent = folder
end
end)
And this script is setup for items
local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
game.Players.PlayerAdded:connect(function(player)
local itemsfolder = Instance.new("Folder")
itemsfolder.Name = "Items"
itemsfolder.Parent = game.Players.LocalPlayer
warn("Player with name like ".. player.Name.. " is ready!")
end)

1 comment
I added a fix to my answer.