of     1   

Snaptor7
#227708597Sunday, November 19, 2017 9:53 AM GMT

So I'm trying to save a variable from my datastore into my playergui... it seems that "Settings" isn't replicating into PlayerGui tho (despite being in StarterGui) and this is gamebreaking. This doesn't happen in studio (although I haven't got API enabled in studio, so that might do it). Script that seems to be causing problems: local function setupPlayerData(player) local data = playerData:GetAsync(player.UserId) if not data then print("Data not found for " + player) data = {["Monster"] = "Ghost"} playerData:SetAsync(player.UserId, data) end sessionData[player] = data player.PlayerGui:WaitForChild("Settings") player.PlayerGui.Settings.PlayerMonster.Value = sessionData[player]["Monster"] end And where it is called in the code (from beginning): game.Players.PlayerAdded:connect(function(player) --Sets up new players player.CharacterAdded:connect(function(character) character.Humanoid.JumpPower = 0 character.Humanoid.Died:connect(function(humanoid) character:FindFirstChild('Humanoid'):UnequipTools() player.Backpack:ClearAllChildren() if player.TeamColor ~= BrickColor.new("Really red") and game.Workspace.Round.Value == true then player.TeamColor = BrickColor.new("Bright red") player.CharacterAdded:wait() waitForCharacter(player) morph(player, monsterType) end end) end) setupPlayerData(player) end) All help appreciated! Thanks, -Snaptor
OzzyFin
#227709149Sunday, November 19, 2017 10:21 AM GMT

When a player's character is added into the game, the _client_ clones everything from StarterGui into its backpack. Due to filtering enabled, these new objects don't replicate to the server and they only exist on the client's machine. What you are doing is still a horrible practice, whether FE was enabled or not. The server should never be manipulating a client's GUIs. Use a RemoteEvent to pass the data to the client which then proceeds to show it on the GUI.
OzzyFin
#227709216Sunday, November 19, 2017 10:24 AM GMT

>backpack PlayerGui* Unlike with GUIs, the server actually clones the content of the StarterPack into the player's backpack whenever their character is added.
Snaptor7
#227709355Sunday, November 19, 2017 10:32 AM GMT

Ah, So what you're essentially saying is that "PlayerGui" is only replicated locally? I'm aware that under any normal circumstances it's a bad idea to alter gui's with the server, but I thought it would be safe to have a value stored in there (since the gui edits that value) and have the server mess with that. I guess I was wrong, lol. Will have to move the value, and possible store it in an entirely different way. Thanks for the help though. =) -Snaptor
OzzyFin
#227709522Sunday, November 19, 2017 10:43 AM GMT

Oh I actually missed that it is a value you're trying to change. I'd still ##### ## ####### ### each to their own. You can store the values like the default ROBLOX leaderboard does; have a folder inside the player and the values in it.
OzzyFin
#227709579Sunday, November 19, 2017 10:47 AM GMT

I'd still stick to remotes*
Voxxie
#227709614Sunday, November 19, 2017 10:49 AM GMT

I only briefly skimmed over your post and didn't look much at the replies so forgive me if I'm off base or late with this response: IIRC, server Scripts can see the PlayerGui instance but can not see anything inside of it as that stuff is client-side
Snaptor7
#227709678Sunday, November 19, 2017 10:54 AM GMT

The whole reason it was in the StarterGui was because the GUI changed the value, so I'm going to need remotes to change it anyway or else only the client will see the change. (Unless values are weird like HumanoidWalkSpeed) -Snaptor
Snaptor7
#227710636Sunday, November 19, 2017 11:56 AM GMT

Got it working, thanks! -Snaptor
OzzyFin
#227711431Sunday, November 19, 2017 12:34 PM GMT

There's nothing special about the walkspeed property. The value doesn't replicate even if it is changed, only its effect of the character moving faster is. That's because the character's position is the only thing being automatically replicated from clients to server.

    of     1