Script cannot detect change in player value?

I have a script which is placed inside of the player when they join the game. The player also has a ‘wanted’ value added to them when they join. This script is supposed to detect when the wantedvalue changes, however, it cannot. Any help would be appreciated, thanks.

code:

local plr = script.Parent
local char = plr.Character
local gui = script.BillboardGui2
local wanted = plr.Wanted
local wantedval = wanted.WantedValue
wanted.Changed:Connect(function()
	print("detected")
1 Like

is the wanted value being changed on the client or the server?

1 Like

The value is being changed on the server.