So I am making this hangout game, Ok, and there is a theme park which you need to pay to open, here is the current script and if you know what's wrong send me the new code. Thanks!
db = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if db == false then
db = true
if player.leaderstats.Cash.value >= 50 then
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - 50
script.Parent.Transparency = 0.6
script.Parent.CanCollide = false
wait(1)
script.Parent.Transparency = 0.5
script.Parent.CanCollide = true
db = false
end
end
end)
Normal script not local.

2 comments
That wait() is so short. Try removing it entirely and the part after it, to see if it's working or not. Also any errors?
That's not the issue, it's because in this line: if player.leaderstats.Cash.value >= 50 then value is undercase when it should be Value