DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 23 Apr 2016 09:43 AM |
I have a stats folder that I want to be linked to each player. The folder is replicated from SeverStorage and put in ReplicatedStorage and named to each player's names. game.Players.PlayerAdded:connect(function(player) local stats = game.ServerStorage.Stats:Clone() stats.Name = player.Name stats.Parent = game.ReplicatedStorage end)
Now I'm trying to access this folder from a script within a ScreenGui setup.
local sp = script.Parent local player = sp.Parent.Parent.Parent.Parent.Parent local playerName = player.Name repeat wait() until player.Character local stats = game.ReplicatedStorage.playerName --This is line 8
The output I get is 10:35:23.332 - playerName is not a valid member of ReplicatedStorage 10:35:23.353 - Script 'Players.Player1.PlayerGui.ClassSelection.Main.Classes.Infantry.Script', Line 8
Thanks |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 09:46 AM |
local stats = game.ReplicatedStorage[playerName]
or
local stats = game.ReplicatedStorage:FindFirstChild(playerName)
|
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
| |
|