Module Script (In workspace)
local DataSave = {} --wait() --game:WaitForChild("ServerStorage") ----game:WaitForChild("DataStoreService") game:GetService("DataStoreService") local SafeStore = game.ServerStorage:FindFirstChild("PlayersData") local mouse = game.Players.LocalPlayer:GetMouse() DataSave.ItemTaken = function() print(game.Players.LocalPlayer.Name) --local mouse = game.Players.LocalPlayer:GetMouse() local Player = game.Players.LocalPlayer --local PlrData = SafeStore:findFirstChild(Player.userId) if mouse.Target ~= nil then if mouse.Target:findFirstChild("CanPickUp") then if mouse.Target:findFirstChild("CanPickUp").Value == true then local Item = mouse.Target:findFirstChild("CanPickUp").Parent print(Item.Name .. " Is what your trying to pick up!") local found = nil local values = Player.Data.SlotHold:GetChildren() for i=1,#values do if values[i].ClassName == "BoolValue" then if values[i].Value == false then found = values[i] break end end end if found ~= nil then print(found) Player.Data.SlotHold:findFirstChild(found.Name).Value = true local CurrentSlot = Player.Data.SlotHold:findFirstChild(found.Slot.Value).Name print(Player.Data.SlotHold:findFirstChild(found.Slot.Value).Name .. " Is line 31") print(CurrentSlot.Name) local SlotTemp = Player.Data.SlotHold:findFirstChild(CurrentSlot) print(SlotTemp.Parent) SlotTemp.ItemName.Value = (mouse.Target:findFirstChild("CanPickUp").Parent.Name) ---CurrentSlot.ItemStock.Value = end if found == nil then print("Invintory Full!") end end end end end return DataSave
Error
ServerStorage is not a caild member of DataModel Script 'Workspace.DataSaveModule', Line 6