spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 06 Nov 2016 09:37 PM |
it worked in SSS a minute ago...
game.Players.PlayerAdded:connect(function(Player) local Level = game.ServerStorage["Player Stats"][Player.Name].Level local Stats = Instance.new("IntValue", Player) Stats.Name = "leaderstats" local LevelV = Instance.new("IntValue", Stats) LevelV.Name = "Level" LevelV.Value = Level.Value Level.Changed:connect(function(Level) LevelV.Value = Level end); end);
|
|
|
| Report Abuse |
|
|
| |
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 06 Nov 2016 09:44 PM |
Ok so i checked to see if it cloned the values and it does, the problem is that the leaderstats aren't coming up on the board but when i dup it it does.
|
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 09:46 PM |
I believe ServerScriptService runs befores workspace scripts
local Level = game.ServerStorage["Player Stats"][Player.Name].Level
Try using waitForChild because whatever object Player.Name is probably doesn't exist yet. Check the online output and see. |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Nov 2016 09:47 PM |
| game.Players.PlayerAdded:connect(function(p) local stat = game.ServerStorage:WaitForChild'Player Stats' local ps = stat:WaitForChild(p.Name) local level = ps:WaitForChild'Level' local ls = ######################## ## ####### = ############# local fake = ######################## ls) fake.Name = 'Level' fake.Value = level.Value level.Changed:connect(function() level.Value = level end) end) |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 06 Nov 2016 09:47 PM |
already tried it, its cloning the values into the player but its not showing up on the actually board.
|
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Nov 2016 09:50 PM |
game.Players.PlayerAdded:connect(function(p) local stat = game.ServerStorage:WaitForChild'Player Stats' local ps = stat:WaitForChild(p.Name) local level = ps:WaitForChild'Level' local ls = Instance.new'IntValue' ls.Name = 'leaderstats' local l = Instance.new('IntValue', ls) l.Name = 'Level' l.Value = level.Value ls.Parent = p level.Changed:connect(function() l.Value = level.Value end) end) |
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 09:54 PM |
| Try parenting the leaderstats at the very end instead of before putting your values in it. |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Nov 2016 09:56 PM |
| What was the point of telling him that? I already did that... x) |
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 06 Nov 2016 10:07 PM |
I restarted studio because yours didnt work and i tested mine again and now it suddenly works. Studio is really weird today, i lost 2 hours of work bc of of :/.
|
|
|
| Report Abuse |
|
|
|
| 06 Nov 2016 10:54 PM |
@Dev Because I didn't see your post...? |
|
|
| Report Abuse |
|
|