Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could i insert a table that is the player's name into a dictionary?

Asked by 6 years ago
Edited 6 years ago

So basically, in a nutshell, I'm attempting to sort an inventory system by putting multiple tables of values into other tables, however I am stumped at how i can achieve this.

local events = game.ReplicatedStorage.Inventory
local playerInventories = {

}
events.PickingUp.OnServerEvent:Connect(function(p,mouse)
    if mouse.target:FindFirstChild("PickUpValue") ~= nil and (p.Character.UpperTorso.position-mouse.hit.p).magnitude <= 10 then
        if playerInventories.p == nil then
            local p = {}
            table.insert(playerInventories,p{})
        end
    end
end)

EDIT: Thanks for any help

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

There's a developer forum page that helps teach how to get the player's name https://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayerFromCharacter not sure how to do anything else though.

0
RemoteFunctions communicating to a server give the player name automatically, which i defined as p in the parameters. frostysubatomiczero 51 — 6y
Ad

Answer this question