Can someone help with this script I cant neither the number or name of an item on my inventory system
--Local Script
local Player = game:GetService("Players")
local RS = game:GetService('ReplicatedStorage')
local LocalPlayer = game.Players.LocalPlayer
local PlayerGUi = LocalPlayer.PlayerGui
local GUI = PlayerGUi:WaitForChild("Inventory")
local InvTemp = GUI.Inventory.ScrollingFrame.invtemp
local InvSroll = GUI.Inventory.ScrollingFrame
local itemsData = require(script.ModuleScript)
local getInventoryFunction = RS:WaitForChild("Remotes"):WaitForChild("getInventory")
local playerItems = getInventoryFunction:InvokeServer()
for itemName, itemData in pairs(itemsData) do
if itemData.Enabled == true then
local newItem = InvTemp:Clone()
newItem.Visible = false
newItem.Parent = InvSroll
newItem.Name = itemName
newItem.TextButton.Text = itemName.Name
newItem:AddTag(itemData.Class)
newItem.TextButton:AddTag("invItem")
end
end
if playerItems then
for itemName , itemData in pairs(playerItems) do
if itemsData[itemData] and itemsData[itemData].Enabled == true then
if itemData.Quantity > 0 then
local item = InvSroll:FindFirstChild(itemName)
item.Visible = true
item.TextButton.UseLabel.Text = 'x'.. itemData.Quantity
end
end
end
end
--Server Script
local RS = game:GetService('ReplicatedStorage')
local Players = game:GetService('Players')
local getinventoryfucntion = RS.Remotes.getInventory
local PID = {}
game.Players.PlayerAdded:Connect(function(player)
PID[player.Name] = {
Wood = {Quantity = 5},
Nails = {Quantity = 2},
}
end)
getinventoryfucntion.OnServerInvoke = function(Player: Player)
local InventoryData = PID[Player.Name]
print(InventoryData)
return InventoryData
end