I have a script here, that when the part is transparent == 0, the player is supposed to get +$50 every 5. I'm not sure how to fix the problem, please help!
while true do
player = game.Players:GetPlayerFromCharacter
if script.Parent.Transparency == 0 then
local stats = player:findFirstChild("leaderstats")
local add = 50
local cash = stats:findFirstChild("Cash")
cash.Value = cash.Value + add
wait(5)
end
end

3 comments
Isn't 1 the transparency for a part?
??
Do you want them to gain cash when the part is visible or invisible? If visible. .Transparency == 0, if invisible, .Transparency == 1. You may also consider adding a wait() statement outside of your conditional statement.