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 » Scripters
Home Search
 

Re: Why does this work in workspace but not SSS

Previous Thread :: Next Thread 
spinywind is not online. 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
NukeLuckyLuke is not online. NukeLuckyLuke
Joined: 08 Apr 2016
Total Posts: 5767
06 Nov 2016 09:43 PM
Weird...
Report Abuse
spinywind is not online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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 is not online. 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 is not online. 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 is not online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
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 is not online. 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 is not online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
06 Nov 2016 10:54 PM
@Dev
Because I didn't see your post...?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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