Ad
Log in to vote
1

Why won't the GUI text change?

Asked by 8 days ago

Here's my code:

local Players = game.Players
local Avatarblock = game.ServerStorage.Avatar_loaderblock
local PlayerNameFolder = game.workspace.PlayerNameFolder
local PlayerNameGui = game.ServerStorage.Avatar_loadermodel.GuiBlock.SurfaceGui.NameLabel



Players.PlayerAdded:Connect(function(player)

    local PlayerName = Instance.new("StringValue", PlayerNameFolder)
    PlayerName.Value = player.Name
    PlayerName.Name = player.Name


    local YourLoaderBlock = Avatarblock:Clone()
    YourLoaderBlock.Name = (PlayerName.Value.. "'s plot") 
    PlayerNameGui.Text = (PlayerName.Value.. "'s plot")





end)

The part where it changes the value works, just looking for the write way to write it for GUIs.

1 answer

Log in to vote
0
Answered by 7 days ago

The PlayerNameGui variable is set to the NameLabel in the ServerStorage service. Changing the PlayerNameGui.Text changes the property within ServerStorage. I'm unsure of what is supposed ot be happening, but the solution is to clone the PlayerNameGui and parent it under whatever you want the SurfaceGui to be on, then change the property.

Ad

Answer this question