I tried to write a code that changes colour of a part if the player have enough money. I changed the code to print players money so i can see if it works. It works if the script is in StarterPlayerScript folder but it doesn't while in the part object. Game includes many parts in diffrent models and i thought that i must copy and paste this script into all parts that i want to change its colur depends on players money. Thanks and sorry for my poor English.
local player = game.Players.LocalPlayer
local playermoney = player:WaitForChild("leaderstats").Money
playermoney.Changed:Connect(function()
print(playermoney.Value)
end)

4 comments
im confused what do you want it to do and what have you already accomplished?
You're going to need to explain better, what part are you trying to change the color of?
If i put this script into StarterPlayerScript folder it works. But when i put it into a part it doesn't. There is diffrent "Buy Buttons" for each player. I try to change these buttons colour if the player have enough money or not.
Ah a tycoon game, ok, I can write up an answer for you.