of     1   

iDemum
#140993720Sunday, July 20, 2014 11:12 PM GMT

Hello, I have a script test, that uses data persistence, so when a user clicks it then rejoins, it clones it and makes it 2 points above the original block. So what I need help with is for someone to change that so it will save there inventory, so if they pick up a weapon and click it then rejoin they will still have the weapon. Here is the code. Ill add comments where you have to change it . Thanks. local Brick = script.Parent local Key = "Part" local Message = Instance.new("Message") game.Players.PlayerAdded:connect(function(Player) Player:WaitForDataReady() local Object = Player:LoadInstance(Key) if (Object ~= nil) then Object.Parent = game.Workspace Object.Anchored = true Object.CFrame = CFrame.new(Brick.Positin+Vector3.new(0,2,0)) --this line above makes it another brick and saves. Message.Text = "Success" Message.Parent = game.Workspace wait(5) Message:Remove() end end) game.Players.PlayerRemoving:connect(function(Player) Player:SaveInstance(Key, Brick) Thanks! end)
Notunknown99
#140993837Sunday, July 20, 2014 11:13 PM GMT

Positin I sense a typo.
Notunknown99
#140993890Sunday, July 20, 2014 11:14 PM GMT

Also, in future you should use F9 (online output)
iDemum
#140994058Sunday, July 20, 2014 11:15 PM GMT

Thanks.
iDemum
#140994126Sunday, July 20, 2014 11:16 PM GMT

But I still need to change it, so I don't really need that part.
Notunknown99
#140994246Sunday, July 20, 2014 11:17 PM GMT

But had you opened the output, you would have seen the error and corrected it ;)
iDemum
#140994806Sunday, July 20, 2014 11:23 PM GMT

Well you can only test it in Play mode, so I couldn't test for errors. xD
Notunknown99
#140994869Sunday, July 20, 2014 11:23 PM GMT

F9 is an online output ;D
iDemum
#140995345Sunday, July 20, 2014 11:28 PM GMT

Ok, well I need a real script help now xD I didn't need fixes I need what I asked xD xD
BothAngles
#140995462Sunday, July 20, 2014 11:29 PM GMT

i have a script that does this and it saves ur backpack for when u respawn easy to make
Notunknown99
#140995797Sunday, July 20, 2014 11:33 PM GMT

Oh, right. Don't save their weapon's Instance, as that will eat your data cost. Instead store all the names of the weapons in a table, like so: local weapons = {} for i, v in next, player.StarterGear:GetChildren() do weapons[i] = v.Name end and then use HttpService:JSONEncode(string) to encode it into a string and use SaveString, then use LoadString and HttpService:JSONDecode(string) to get the table back, then iterate through it and clone the weapons from ServerStorage into their Backpack/StarterGear.

    of     1