Help, please.
game.Players.PlayerAdded:Connect(function(plr)
table.insert(_G.CashData,plr.Name)
table.insert(_G.CashData[plr.Name],0)
end)
Help, please.
game.Players.PlayerAdded:Connect(function(plr)
table.insert(_G.CashData,plr.Name)
table.insert(_G.CashData[plr.Name],0)
end)
Well, it seems you are new to using tables so let me go ahead and fix it up for you...
game.Players.PlayerAdded:Connect(function(plr)
_G.CashData[plr.Name] = 0
end)
Alright, so the correct way to use table.insert is if you are going to insert a single value or table without a indexed name. But for this, it does have a indexed name which is the players name.
I'm kind of busy so I can't really go into depth but if you have any other questions let me know.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
what are you trying to do?
oh I see now, you're attempting to edit a dictionary in _G? I would strongly recommend most any other method
make a table insert when a player joins
what is another method?