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
 

Re: Why doesn't this work?

Previous Thread :: Next Thread 
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
23 Apr 2013 12:54 PM
game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady()

wut = Instance.new("IntValue", player)
wut.Name = "Pin"
p = Instance.new("IntValue", player)
p.Name = "One"
o = Instance.new("IntValue", player)
o.Name = "Correct"
z = Instance.new("IntValue", player)
z.Name = "Two"
chuck = pcall(function()player:LoadNumber("Pin") end)
wut.Value = chuck
end)

game.Players.PlayerAdded:connect(function(player)
repeat wait() until player:FindFirstChild("Pin") ~= nil
player.Pin.Changed:connect(function()
pcall(function() player:SaveNumber("Pin", player.Pin.Value) end)
end)
end)
Report Abuse
KeyUp is not online. KeyUp
Joined: 17 Mar 2013
Total Posts: 457
23 Apr 2013 12:59 PM
[ Content Deleted ]
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
23 Apr 2013 01:17 PM
That doesn't fix it all you did was remove the player added function.
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
23 Apr 2013 01:43 PM
bump.
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
23 Apr 2013 01:48 PM
What isn't working? What's it supposed to do, vs what is it doing? Does it provide any output? Etc.

We can't really help you if you don't tell us what you need help with.

I would make a suggestion though, if you can, combining the functions in those two events would be beneficial to your scripting habits.

game.Players.PlayerAdded:connect(function(player)

player:WaitForDataReady()

Pin= Instance.new("IntValue", player)
Pin.Name = "Pin"
Pin.Value = pcall(function() player:LoadNumber("Pin") end)

local One = Instance.new("IntValue", player)
One.Name = "One"

local Correct = Instance.new("IntValue", player)
Correct.Name = "Correct"

local Two = Instance.new("IntValue", player)
Two.Name = "Two"

Pin.Changed:connect(function()
pcall(function() player:SaveNumber("Pin", Pin.Value) end)
end)
end)
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
23 Apr 2013 01:51 PM
It provides no output and all it is suppose to do is load/save a number
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