I've been playing around with int values to store how much "sand" there is in a sandpile or container, but I was storing the values inside the models in the workspace and from what I read it is not a good way to do it. so is this code better or is it not safe enough when the script is under the model in the workspace?
local Material = script.Parent.Material local value = 0 Material.Parent.CollisionDetector.Touched:Connect(function(hit) if hit.Name == "DropOFF" then Material.Transparency = 0 value = value + 1 game:GetService("Debris"):AddItem(hit,1) print(value) end end)