#Players able to keep farming leaderstats (code below)

1 messages · Page 1 of 1 (latest)

split epoch
#

This is my code within each touchdetecter

db = false

script.Parent.Touched:Connect(function(hit)
    local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
    if plr then
        if db == false then
            db = true
            plr.leaderstats["Celebs Found"].Value += 1
        end
    end
    wait(5)
    db = false
end)


this is leaderstats code:

game.Players.PlayerAdded:Connect(function(player)
    
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player


    local celebsFound = Instance.new("IntValue")
    celebsFound.Name = "Celebs Found"
    celebsFound.Value = 0
    celebsFound.Parent = leaderstats
end)

#

Players able to keep farming leaderstats (code below)

#

i want people to get +1 only once per touch detector

noble otter
split epoch
#

how do i fix my scri[t

barren ledgeBOT
#

studio** You are now Level 2! **studio

grave kindle
#

personally i would put the if db==false then statement first