Play on remove, not being able to be set to true from script

This is the code.

script.Parent.hitttt.PlayOnRemove = true
--task.wait()
script.Parent.hitttt:Destroy()

I noticed that in all my games, that you cannot use .PlayOnRemove = true in script because it doesn’t work

But if I set PlayOnRemove to true from the studio then it works

I even tried putting task.wait() to give it time to process that its set to true

Should I report this as a bug?

never mind, for those who also experienced it and do not know how to fix it,
the solution is to put task.wait(0.01) because it really needs time to process that its set to true I guess

here’s working code

script.Parent.hitttt.PlayOnRemove = true
task.wait(0.01)
script.Parent.hitttt:Destroy()
I noticed that in all my games, that you can