generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

What wrong with this script?

Previous Thread :: Next Thread 
chewit9 is not online. chewit9
Joined: 22 May 2009
Total Posts: 7873
22 Feb 2013 08:42 AM


points = "EXP"
points2 = "Level"
points3 = "Candy"


game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
p:WaitForDataReady()
p.Backpack:Remove()
wait()
Backpack = p:LoadInstance("Backpack")
Backpack.Parent = p
wait()
if p:FindFirstChild("Backpack") == nil then
Instance.new("Backpack", p)
c = game.StarterPack:GetChildren()
for i = 1, #c do
c[i]:clone().Parent = p.Backpack
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local points = Instance.new("IntValue")
points.Name = points
points.Value = 0
points.Parent = stats
stats.Parent = p
local points2 = Instance.new("IntValue")
points2.Name = points2
points2.Value = 0
points2.Parent = stats
stats.Parent = p
local points3 = Instance.new("IntValue")
points3.Name = points3
points3.Value = 0
points3.Parent = stats
stats3.Parent = p
local num = plr:LoadNumber("Number")
p.leaderstats[points].Value = num
local num2 = plr:LoadNumber("Number2")
p.leaderstats[points2].Value = num
local num3 = plr:LoadNumber("Number3")
p.leaderstats[points3].Value = num
end
end
end)
end)

game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
p:SaveInstance("Backpack", p.Backpack)
p:SaveNumber("Number", plr.leaderstats[points].Value)
p:SaveNumber("Number2", plr.leaderstats[points2].Value)
p:SaveNumber("Number3", plr.leaderstats[points3].Value)
end)
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
22 Feb 2013 08:51 AM
I'm not going to look into this until you tell us if there is any error (output) and what the problem is which you are experiencing. We cannot smell "what is wrong" because if this script runs we cannot even tell you if it's wrong because we don't know your intention with the script.
Report Abuse
chewit9 is not online. chewit9
Joined: 22 May 2009
Total Posts: 7873
22 Feb 2013 08:53 AM
The intention is to auto save your leaderstats and backpack, the problem is it doesn't do either, and there is no output error.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
22 Feb 2013 08:55 AM
Where are you testing this - on a server, on your computer?

What type of script is it (LocalScript, Script?)
Report Abuse
chewit9 is not online. chewit9
Joined: 22 May 2009
Total Posts: 7873
22 Feb 2013 08:56 AM
I'm testing this on a game, and script.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image