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.
Your line:
if player.leaderstats.Cash.value >= 50 then
should be:
if player.leaderstats.Cash.Value >= 50 then
On your line you have:
``player.leaderstats.Cash.Value = " so is that it as the code hasn't been finished? I am new to scripting btw.