Hey there so I’ve got a IntValue Inside of a part and I’m trying to make it Print something whenever the value is changed but It doesn’t work and also doesn’t give me an error Any help or suggestions are much appreciated.
Yeah I don’t know but when I first started using valueobjects they were like this and glitched a lot without really a good explanation. Try putting the script in ServerScriptService? I think a script that’s parent to it wont work.
If you’re testing in Studio and using the Play Solo mode (where you’re controlling your character), then you need to switch to the Server mode before you change the value, because it’s a server-side script listening for the change. From the Client mode, the change isn’t picked up by the server:
<< Client (won’t see change) | Server (will see change) >>
I was trying to debug a similar issue for like 30 minutes the other day, and this was the problem.
Side-note, but the argument passed to Changed for BaseValue objects is the new value. So the argument plr will be the new value. Might want to use a better name, because it looks like “player” but isn’t the player.