GetPropertyChangedSignal does not work

ye, you are right. Script in the serverScriptService

1 Like

hmmm… strange. What do I have to do to get it to work? I have the script in ServerScriptService, and the gui is originally in serverStorage.

1 Like

You can try to re-locate the gui from serverstorage to lighting?

local Lighting = game:GetService("Lighting")
local statUnder = Lighting:WaitForChild("statUnder")

local abbreviations = {
	"",
	"K",
	"M",
	"B",
	"T"
}

local function abbreviateNumbers(Number)
	for  i = 1, #abbreviations do
		if Number < 10 ^ (i * 3) then
			if abbreviations[i] == "∞" then
				return "∞"
			else
				return math.floor(Number / ((10 ^ ((i - 1) * 3)) / 100)) / (100) .. abbreviations[i]
			end
		elseif tostring(Number) == "Inf" then
			return "∞"
		end
	end
end

local RebirthValues = {
	[0] = "🤓Noob",
	[1] = "😑Beginner",
	[2] = "🙂Rookie",
	-- ... complete the list
}

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local leaderstats = player:WaitForChild("leaderstats")
		local Power = leaderstats:WaitForChild("Power")
		local Mass = leaderstats:WaitForChild("Mass")
		local Rebirth = leaderstats:WaitForChild("Rebirth")

		local Head = character:WaitForChild("Head")

		local uiClone = statUnder:Clone()
		uiClone.Name = "StatUnderClone"
		uiClone.Parent = Head

		local uiClone2 = Lighting:WaitForChild("rebirthUnder"):Clone()
		uiClone2.Name = "RebirthUnderClone"
		uiClone2.Parent = Head

		local function update()
			uiClone.stat.Text = abbreviateNumbers(Power.Value + Mass.Value).. " Power"
			print("update Power")
		end

		local function updateRebirth()
			uiClone2.stat2.Text = RebirthValues[Rebirth.Value]
		end

		update()

		task.wait(1)

		updateRebirth()



		Power.Changed:Connect(update())
		Mass.Changed:Connect(update())
		Rebirth.Changed:Connect(updateRebirth())

		character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None

	end)
end)
1 Like

How about when you call the functions here:

Do the print statements inside update and updateRebirth print? Or do they not print at all?

1 Like

I pseudo-tested your code and everything worked fine. catalinprooo, also tested the code and it worked. So, my assumption is as follows:

You’re likely changing the leaderstat values locally so the server doesn’t detect the changes. Make sure that when you change the values in leaderstats, you do it from a server script.
If you’re certain that you’re changing the values from the server, could you show us the function that changes the leaderstat values?

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.