yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
|
| 31 Jul 2014 08:26 AM |
Yeah, I should change to the datastores but I'm to lazy to learn them.
But still I got myself stuck here. The data doesn't appear to be working annyhow.
game.Players.PlayerAdded:connect(function(p) if p.DataReady then print "loading" script.Parent.txt.Text = (tostring(p:LoadNumber("Money")).."$") print "loaded" end end)
script.Money.Changed:connect(function(newVal) player:SaveNumber("Money",newVal) script.Parent.txt.Text = (tostring(newVal).."$") print(newVal) end) |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 31 Jul 2014 09:28 AM |
Data_P FTW
What do you mean when you say "doesn't appear to be working"?
Also, you can save a loop by replacing if p.DataReady with p:WaitForDataReady () |
|
|
| Report Abuse |
|
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
|
| 31 Jul 2014 09:31 AM |
| Well it doesn't load anny data I also tried to use a print in the function but no otuput. It doesn't register a player joining. |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
| |
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
|
| 31 Jul 2014 09:34 AM |
This wont even work and I can't find annything that's wrong with it. The script is inside a playerGui
game.Players.PlayerAdded:connect(function(p) print"meh" end)
|
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 31 Jul 2014 09:35 AM |
PlayerAdded is one of the most reliable events I know.
Are you testing this in Play Solo? |
|
|
| Report Abuse |
|
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
| |
|
|
| 31 Jul 2014 10:10 AM |
I remember when I thought data p was better than data store.
Ohh, the good ol days. But data p's trash now. |
|
|
| Report Abuse |
|
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
|
| 31 Jul 2014 10:14 AM |
Annything wrong with this line? player.PlayerGui.money.image.txt.Text = (tostring(player:LoadNumber(Money)).."$") |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 31 Jul 2014 10:15 AM |
Is this in a LocalScript?
@Accomplishable, if that print statement inside the function isn't printing, then this isn't a matter of Data_P at all. |
|
|
| Report Abuse |
|
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 31 Jul 2014 10:22 AM |
Put this in ServerScriptService, not PlayerGui. You'll have to change the hierarchies accordingly. |
|
|
| Report Abuse |
|
|
| |
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
| |
|