Script not working (no errors)

  1. What do you want to achieve?
    I have a little GUI I made with a script inside it that sets a picture to the player’s profile picture and a text label to the player’s name and renames the GUI to the player’s name, well that’s what’s suppose to happen.
  2. What is the issue?
    The issue is that it only sets the text but doesn’t rename or add a new picture to the GUI.
  3. What solutions have you tried so far?
    I have tried looking around on the devForum and messing with the script.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

the script that “applies” the changes

script.Parent.user:GetPropertyChangedSignal("Value"):Connect(function()
	
	local plrService = game:GetService("Players")
	local plr = plrService[script.Parent.user.Value]
	local id = plr.UserId
	
	script.Parent.name.Text = script.Parent.user.Value -- setting GUI text  (working)
	script.Parent.Name = script.Parent.user.Value -- setting frame name for removing use later (not working)
	
	local thumbType = Enum.ThumbnailType.HeadShot
	local thumbSize = Enum.ThumbnailSize.Size420x420
	local content, isReady = plrService:GetUserThumbnailAsync(id, thumbType, thumbSize)
	
	script.Parent.pro.Image = content -- setting GUI pictureLabel (not working)
	
end)

applier script location
image
the script that spawns the GUI’s

local ScrollingFrame = script.Parent
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local frame = RS:WaitForChild("Prefabs").Player
local starterGUI = game:GetService("StarterGui")

Players.PlayerAdded:Connect(function(plr)
	
	for index, value in pairs(Players:GetChildren()) do
		local gui = frame:Clone()
		gui.Parent = value.PlayerGui:WaitForChild("Simpli").Container.MainFrame.PlayerList.Scroll
		gui.user.Value = plr.Name
	end
	
	local gui = frame:Clone()
	gui.Parent = starterGUI.Simpli.Container.MainFrame.PlayerList.Scroll
	gui.user.Value = plr.Name

end)

Players.PlayerRemoving:Connect(function(plr)
	for index, value in pairs(Players:GetChildren()) do
		if value == plr then return end
		value.PlayerGui.Simpli.Container.MainFrame.PlayerList.Scroll[plr.Name]:Destroy()
	end
	
	starterGUI.Simpli.Container.MainFrame.PlayerList.Scroll[plr.Name]:Destroy()
end)

(its located in ServerScriptService)
outcome
image
(same in starterGUI(you’ll only understand this note if you looked thru the script))

To see if anything changed you should go to game > Players > {the player} > PlayerGui, changes wont appear in StarterGui or ReplicatedStorage.

What I noticed is that the frame still has the name Player. In your previous post it is possible to see that the default text is your username, which is why it looks like it works. Try printing something, to check if the script does work.

Thats where I did check game.Players.myName.ThenThePathToTheFrame

So images may take quite a while to load, so tht mite b causing ur issue, I suggest u wait for a while.

You were right, for some reason it doesn’t detect the value change so I just decided to check if the parent is changed, which worked.

local function updateAll()
	local plrService = game:GetService("Players")
	local plr = plrService[script.Parent.user.Value]
	local id = plr.UserId

	script.Parent.name.Text = script.Parent.user.Value -- setting GUI text  (working)
	script.Parent.Name = script.Parent.user.Value -- setting frame name for removing use later (not working)

	local thumbType = Enum.ThumbnailType.HeadShot
	local thumbSize = Enum.ThumbnailSize.Size420x420
	local content, isReady = plrService:GetUserThumbnailAsync(id, thumbType, thumbSize)

	script.Parent.pro.Image = content -- setting GUI pictureLabel (not working)
end

script.Parent.user:GetPropertyChangedSignal("Value"):Connect(function()
	updateAll()
end)

script.Parent:GetPropertyChangedSignal("Parent"):Connect(function()
	updateAll()
end)
1 Like

They usually load in like 0.2 seconds every time for me.

local function updateAll(Value)
	local plrService = game:GetService("Players")
	local plr = plrService[Value]
	local id = plr.UserId

	script.Parent.name.Text = Value -- setting GUI text  (working)
	script.Parent.Name = Value -- setting frame name for removing use later (not working)

	local thumbType = Enum.ThumbnailType.HeadShot
	local thumbSize = Enum.ThumbnailSize.Size420x420
	local content, isReady = plrService:GetUserThumbnailAsync(id, thumbType, thumbSize)

	script.Parent.pro.Image = content -- setting GUI pictureLabel (not working)
end

script.Parent.user.Changed:Connect(updateAll)

script.Parent:GetPropertyChangedSignal("Parent"):Connect(function()
	updateAll(script.Parent.user.Value)
end)

Use the Changed event/signal for value objects.

I used to do that then it stopped working and after some research I found out about :GetPropertyChangedSignal() which worked