Is “Metalp” wrote on purpose?
Try using plr:WaitForChild(“Resources”):Waitforchild(“Metalp”).Value += 1
If this doesn’t work can you send the line of the error? (Number)
The parameter of the “.Changed” event of a “-Value” instance represents the new value of the “Value” property for that “-Value” instance not the player instance of which the value may have changed for.
That’s why the functions thinks the parameter “plr” (function variable) is a number value of 2.
You’ll need to find some other way to fetch the correct player instance.
Thanks for mentioning that. I tried saying it earlier, in my code snippet though lol.
A “part” of the code snippet so people don’t need to click the link to see it:
script.Parent.Metal.Changed:Connect(function(value)
if value > 0 then
local transparency = 1 - (value/4)
script.Parent.Parent.Thing.Transparency = transparency
script.Parent.Parent.Thing2.Transparency = transparency
script.Parent.Parent.Thing3.Transparency = transparency
elseif value == 0 then
-- .Changed doesn't pass the player who changed the value
-- you'd need another method for giving the player's stats
script.Parent:Destroy()
end
end)