I want to make a failsafe script for a Leaderstats value and other scripts will be using it as the users rank
could i make it so if other scripts would use Statvalue.Changed they would only get the filtered Value by the watch script?
The script checks the value and if it’s not a valid rank it resets it so i wouldn’t error any script by having someones rank be some random string if it somehow glitches when a script changes it
so could i have a script look at it first and only then allow it like a “Changing” event like playerleaving so other scripts don’t get bad data?
what script gets the .changed event first??
script.Parent.Changed:Connect(function()
local prp = script.Parent.Value
if table.find(_G.r,prp) then else script.Parent.Value = "Player" end
end)
I don’t really think it will be possible for the value to glitch out, unless the way you are changing it is really weird.
I personally don’t think you need to worry about the data glitching, however if you still insist on adding stuff, the way you could do it is have every Value.Changed thing have a task.wait() yield (really short delay), and have another script which detects the change and processes it, without having any yield.