LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
|
| 11 Oct 2011 04:55 AM |
local packer --Used in pcall function to save their data later.
game.Players.PlayerRemoving:connect(function(Player)--Checks to save the data when player's about to leave Player:WaitForDataReady()--Make sure the data is primed to save before leaving... otherwise bad things happen lol. Player:SaveInstance("Pack", Player.StarterGear)--And now we save their current gear. end)--Closes the function.
game.Players.PlayerAdded:connect(function(newPlayer)--When a player loads into the game. newPlayer:WaitForDataReady()--Make sure the data is primed for loading. local success = pcall(function() packer = newPlayer:LoadInstance("Pack") end)--Checks to make sure that the player has gear to load. if not success then--Welcome newbie! print("Error: This is player's 1st visit, will save pack on player leaving...")--We'll save your data when your finished pwning zombies :3 else--Hello past user, enjoy the game! print("Player's startergear found... loading now.")--Load that gear that they worked nice n hard for p = newPlayer:LoadInstance("Pack")--Well, we already saved it, so lets load er up for he/she. local start = p:GetChildren()--Starterpack inside of a starterpack = script sparta! start.Parent = player.StarterGear--Now that we have the gear, lets load it into their gear. p:Remove()--Hopefully get rid of the inserted data, so we don't have issues. end end)--Then close it all out.
Ok, I'm not sure if there are issues with this, but my boss owns a very famous game, so I don't want to mess up, so just looking at the code, would this work hopefully?
Purpose: When player is finished slaughtering zombies, it saves the gear they earned, and loads it when they come back. Does it work?: Need a opinion on issues before I even upload it.
If anyone could say if this would work or not, it'd be great. Thanks! LCPLgeek Developer/Manager BTSTI |
|
|
| Report Abuse |
|
|
LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
|
| 11 Oct 2011 04:56 AM |
| I want to make sure this works, please help! |
|
|
| Report Abuse |
|
|
LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
| |
|
LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
|
| 11 Oct 2011 05:00 AM |
| Someone, no fixing required, just point out any possible errors that might occur. |
|
|
| Report Abuse |
|
|
LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
|
| 11 Oct 2011 05:02 AM |
| All I want is an opinion. Please? |
|
|
| Report Abuse |
|
|
LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
|
| 11 Oct 2011 05:04 AM |
| Wow, so silent on this thread -_- |
|
|
| Report Abuse |
|
|
|
| 11 Oct 2011 05:54 AM |
| Sorry I would help but I havent really worked with persistance that much.So I mostlikely woulden't know. |
|
|
| Report Abuse |
|
|
LCPLgeek
|
  |
| Joined: 28 Dec 2009 |
| Total Posts: 2770 |
|
|
| 11 Oct 2011 05:12 PM |
| That's ok, I just want to make sure that it works before I publish to boss. |
|
|
| Report Abuse |
|
|