local repStorage = game:GetService("ReplicatedStorage")
local remote = repStorage.Remotes:WaitForChild("grabRemote")
local closestCrystal = script.Parent
remote.OnServerEvent:Connect(function(player)
local playername = player.Name
local Character = player.Character
if (closestCrystal.position - Character.HumanoidRootPart.Position).magnitude < 15 then
if closestCrystal.grabbable.Value == true then
local playerinventory = require(game.Players[playername].Inventory.Inventory)
if table.find(playerinventory, "GreenKyber" ) == nil then
local GreenKyber = {1}
table.insert(playerinventory, #playerinventory + 1 or 1 , GreenKyber)
end
end
end
end)
This is my first inventory system, and I'm attempting to add an item to the players inventory once they fire a remote. However when I do this it doesn't show an output, which does include errors, succses ect.

1 comment
well i don't now