StringValue not copying

So I have this piece of script:

script.Parent.DialogeScreen.Frame.PlayerName.Text = game.ReplicatedStorage.Message.SpeakerName.Value
	print(script.Parent.PlayerName.Text)

And it does not copy what is in the StringValue in ReplicatedStorage!
Why? And how can I fix this?

I added the print to see what it would say, and it just printed no text (but the print worked, there was just no text it printed).

Where are you setting the StringValue etc? Can’t tell much with this little script, also you’re printing script.Parent.PlayerName not script.Parent.DialougeScreen.Frame.PlayerName

Try printing where you have navigated to in the script before the line where you actually use that value, this would be used to debug and see if the cause of issue is in the value itself or not, because currently all you are checking is if it has copied after.

I am setting the stringValue from another script, and whenever GetPropertyChangedSignal('Value') it should copy what the StringValue’s Value is, which is just a small sentence.

The StringValue contains the text which I want the Text to be in my TextLabel.

I am aware of that, try printing that StringValue before you use it to see if it is the cause of problem.

I saw that it printed nothing, again, but I managed to fix it by adding a…
you guessed it…
wait()

Ah, so this is solved? Your issue would have been that there was no string to copy when you referenced it, which you would have seen when printing it before referencing it. Glad to see it’s solved, good luck on whatever you are working on.

1 Like

Thank you very much!
Also another thing, how would I get a HeadShot to an ImageLabel in StarterGui? The player is already defined, and the image is working, however it gives me this instead of the player: image

Am I correct in thinking you want the players head in the image?

Yep! But it gives me that template face.

Right ok, can I see the code behind this?

PlayerService = game:GetService("Players")
function MakePlayerImage(player)
	local Image = ""
	local success, error = pcall(function()
		local ID = PlayerService:GetUserIdFromNameAsync(player) or ""
		local PlayerImage, IsReady = PlayerService:GetUserThumbnailAsync(ID, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
		if IsReady then
			Image = tostring(PlayerImage)
		else
			Image = ("https://roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=%s"):format(player.Name)	
		end
	end)
	if success then
	else
		Image = ("https://roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=%s"):format(player.Name)	
	end
	PlayerImages[player.Name] = Image
end

Hmm i’m not to sure. I’m not briliant at scripting and this is slightly out of my depth. I felt I was qualified to provide help with your initial question, as it is an issue I have encountered myself before. I’d advise you refer to this post I have found, specifically the solution that has been marked.

Alrighty, I’ll take a look at it.

Great, have a good day and good luck.

1 Like