#How do I change values from the leaderboard on a server script?

1 messages · Page 1 of 1 (latest)

heavy beacon
#

This problem is probably so simple for you guys but I'V BEEN TRYING ON FIXING THIS FOR THE ENTIRE DAY NOW! PLEASE HELP ME.

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

local Litters = Instance.new("IntValue", leaderstats)
Litters.Name = "Litters"
Litters.Value = 0

end)**

--This script is my leaderboard script, very basic and simple leaderboard script. Idk I'm just putting this here because I thought this will be important

**local Tool = script.Parent
Tool.Activated:Connect(function(player)
game.Workspace["HQ Bloxy Cola Drink Sound"]:Play()
wait(2)
local ToolPosition = Tool:FindFirstChild("Handle").Position
if game.ReplicatedStorage.Trash then
local Trash = game.ReplicatedStorage.Trash:Clone()
Trash.Position = ToolPosition
Trash.Parent = game.Workspace

else
    print("It don't work mane.")
end
local Litters = player.leaderstats.Litters
Litters.Value = Litters.Value + 1

end)**

--This is the script for the tool that is suppose to give you +1 for the value of your Litters when activated or clicking the tool.)
--I'v tried so much methods to get this working and I even rewatched the tutorial where I first learned on how to make a leaderboard to check if I made mistakes but I didn't(I don't think.)

--Here is a video where I test it.

Notes:
--You may DM me for more questions or you can just post them here.
--I might give you access to the game(Just don't ruin it please)
--Sice I gave you access to the game, you can give me sugestions or even add stuff as long as I know what you're doing.

twin berry
#
game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder", player)
    leaderstats.Name = "leaderstats"

    local Litters = Instance.new("IntValue", leaderstats)
    Litters.Name = "Litters"
    Litters.Value = 0
end)

--This script is my leaderboard script, very basic and simple leaderboard script. Idk I'm just putting this here because I thought this will  be important



local Tool = script.Parent
Tool.Activated:Connect(function(player)
    game.Workspace["HQ Bloxy Cola Drink Sound"]:Play()
    wait(2)
    local ToolPosition = Tool:FindFirstChild("Handle").Position
    if game.ReplicatedStorage.Trash then
        local Trash = game.ReplicatedStorage.Trash:Clone()
        Trash.Position = ToolPosition
        Trash.Parent = game.Workspace

    else
        print("It don't work mane.")
    end
    local Litters = player.leaderstats.Litters
    Litters.Value = Litters.Value + 1
end)
#

I can help i think

#

the script is in the tool right?

#

@heavy beacon

heavy beacon
#

Yes, except the leaderboard script which is the first one

#

Ill try to understand this, tysm! For trying to help me

#

I will update the tag when I try this out later, again thank you for trying to help!!

heavy beacon
#

@twin berry , are you active still?

#

I got a thing I want to test

twin berry
#

kinda

#

im about to leave

heavy beacon
#

oh nah it's ok

heavy beacon
#

nvm I fixed it, I'm an idiot. I didn't know anything about RemoteEvents until now

twin berry
#

Lol

#

If you need help in the future, dm me the full scripts as well as the error and I’ll try to solve