Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isn't my :GetPropertyChangedSignal() Firing?

I am making a part of my in ServerScriptService that updates the DataStore for player leader boards. It is displaying the leaderboard's data correctly though when I use :GetPropertyChangedSignal() and change the players Coin Multiplier from the server it does not detect that. I am getting no errors in the output. Here is my script:

print("Connecting") --Prints
game:GetService("Players").PlayerAdded:Connect(function(plr)
	plr:WaitForChild("playerVariables"):WaitForChild("PlayerRebirthMulti").Value:GetPropertyChangedSingal("Value"):Connect(function()
		print("Changed") --Doesn't print when player's Coin Multiplier is changed.
		local UserInLeaderboards = false
		for a = 1, 15 do
			if plr:WaitForChild("playerVariables"):WaitForChild("PlayerRebirthMulti").Value > leaderstatsUserValues[a] then
				for b = 1, 15 do
					if leaderstatsUserNames[b] == plr.Name then
						UserInLeaderboards = true
						table.remove(leaderstatsUserNames, b)
						table.remove(leaderstatsUserValues, b)
						table.insert(leaderstatsUserNames, a, plr.Name)
						table.insert(leaderstatsUserValues, a, plr:WaitForChild("playerVariables"):WaitForChild("PlayerRebirthMulti").Value)
					end
				end
				if UserInLeaderboards == false then
					table.remove(leaderstatsUserNames, 15)
					table.remove(leaderstatsUserValues, 15)
					table.insert(leaderstatsUserNames, a, plr.Name)
					table.insert(leaderstatsUserNames, a, plr:WaitForChild("playerVariables"):WaitForChild("PlayerRebirthMulti").Value)
				end
				game:GetService("DataStoreService"):GetDataStore("LeaderboardRebirthMultiUserNames"):SetAsync(0, leaderstatsUserNames)
				game:GetService("DataStoreService"):GetDataStore("LeaderboardRebirthMultiUserValues"):SetAsync(0, leaderstatsUserValues)
			end
		end
		UserInLeaderboards = false
	end)
end)
print("Connection Complete") --Prints

This script is a Normal Script in ServerScriptService. I've tried other solutions as putting connecting :GetPropertyChangedSignal() To the variable when setting it but it errors saying: GetPropertyChangedSignal is not a valid member of IntValue.

1 answer

replace the third line with

plr:WaitForChild("playerVariables"):WaitForChild("PlayerRebirthMulti"):GetPropertyChangedSignal("Value"):Connect(function()

it works like this instance:GetPropertyChangedSignal("ThePropertythatchangesOfThat instance")

also intValue has already a changed event, so this would be even better:

plr:WaitForChild("playerVariables"):WaitForChild("PlayerRebirthMulti").Changed:Connect(function()

8 comments

0

????? hover on it and select view source

0

Neither of those solutions fired. also take account that i'm not a idiot.

0

also you lagit changed like nothing

0

how are u changing it ? in by manually selecting it in studio ?

0

you are checking serversided atm, so if you make the changes clientedsided the server doesnt see that and the event wont fire

0

I allready change it serverside Did you not read me saying to take account that i'm not a idiot. And if I change it manually I go to the server tab to do it which should not cause any issues.

0

Add between line 28 and 29 a wait(10) and plr.playerVariables.PlayerRebirthMulti.Value = 10 see if its fires

0

I figured out a different solution that works, Kinda just decided to add the data store sync to the rebirth event

This discussion is preserved as it was. New answers, comments, and votes are closed.