Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I add a point to the player's leaderboard once the screen is clicked with a tool?

Asked by 4 years ago
Edited by theking48989987 4 years ago

In simpler terms, how do I add a point to the player's leaderboard once the screen is clicked with a tool in their hand

local serverStorage = game:GetService("ServerStorage")

game.Players.PlayerAdded:Connect(function(player)


    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local total = Instance.new("NumberValue")
    total.Name = "Total Water"
    total.Parent = leaderstats

    local rebirths = Instance.new("IntValue")
    rebirths.Name = "Rebirths"
    rebirths.Parent = leaderstats

    local dataFolder = Instance.new("Folder")
    dataFolder.Name = player.Name
    dataFolder.Parent = serverStorage.RemoteData

    local debounce = Instance.new("BoolValue")
    debounce.Name = "Debounce"
    debounce.Parent = dataFolder
end)

Answer this question