#LBStats not poping up in game

165 messages · Page 1 of 1 (latest)

dim falcon
tiny steeple
#

Where "=" lmao?

dim falcon
#

wym

tiny steeple
dim falcon
#

u have to do clicks =

#

?

tiny steeple
#

yea

dim falcon
#

💀

#

still not working

young lagoon
#
local click = instance.new..blablabla```
should work
#

same with gems

#

add a =

tiny steeple
#
local MyName = "AVG"

You need that "=" to set the variable

dim falcon
prisma pulsarBOT
#

studio** You are now Level 1! **studio

tiny steeple
#

Also, when you see red lines, you already should know that there is an erorr

#

Also, use output, thats more helpful to debug and fix

young lagoon
#

I mean, newer scripters don't know that yet, so it's not bad if you didn't know

dim falcon
#

is the pic i sent the correct code tho

#

bc its still not working

young lagoon
#

enable this

tiny steeple
young lagoon
#

then show us the error it gives

young lagoon
dim falcon
#

it doesnt show an error

young lagoon
#

anyways, @dim falcon , show us what the script returns

tiny steeple
#

I said "almost" tho :))))

dim falcon
#

just this

young lagoon
#

that's not the right button

#

this one

tiny steeple
young lagoon
#

2nd in the top row (from the small icons)

dim falcon
young lagoon
dim falcon
#

nope

young lagoon
#

then what's the issue?

dim falcon
#

the stats wont pop up on lb

tiny steeple
#

Thats a dada script, right? Hope you have API access enabled

dim falcon
#

i do

#

its a data script

young lagoon
#

is profile.Data.Clicks = nil?

dim falcon
#

no

tiny steeple
#

Sure about that? Do a print

young lagoon
#

I hope profile.Data.Clicks isn't a NumberValue

dim falcon
#

only =nil is have is Manager.Profiles[player] = nil

young lagoon
#

wait, so can it not receive the profile?

prisma pulsarBOT
#

studio** You are now Level 9! **studio

young lagoon
#

btw, are you using profile service?

dim falcon
#

idk what that is

young lagoon
#

then probably not

#

What is Manager.Profiles?

dim falcon
#

if the player cant load data it kicks them

young lagoon
#

LoadProfileAsync?

dim falcon
#

i believe so

young lagoon
#

are you sure you're not using profile service?

dim falcon
#

how do u know if u are

young lagoon
#

it's a plugin

#

and yeah you are

dim falcon
#

found it

young lagoon
#

Did you add the ProfileService scripts in correctly?

dim falcon
prisma pulsarBOT
#

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

dim falcon
#

does it matter if its in a folder for not

young lagoon
#

it shouldn't matter if the dotnavigator still gets everywhere it's supposed to go

dim falcon
#

does this matter

young lagoon
#

does it stackend?

dim falcon
#

idk what that means

young lagoon
#

does the output mention any stack ends

dim falcon
#

whats a stackend

young lagoon
#

send a screenshot of the output

dim falcon
#

alr

young lagoon
#

are there any other messages in the output?

#

any blue ones?

dim falcon
#

no

young lagoon
#

then the script should work

#

what even is the expected outcome?

dim falcon
#

its supposed to show gems and clicks on the lb

young lagoon
#

do you've a folder named "leaderstats"?

#

oh or well, I know you've a folder named that, but is the name exactly "leaderstats"

#

and is it a direct child of Player

dim falcon
#

yeah

young lagoon
#

test the game

#

then go to the explorer and make a screenshot of the NumberValues inside leaderstats

#

just to make sure everything is in the right place

dim falcon
#

wait do u mean like a physical folder

#

like inside serverscriptservice

young lagoon
dim falcon
young lagoon
#

no

#

press start

#

then go to the explorer

#

players>(your player)>leaderstats>the values

dim falcon
#

explorer?

young lagoon
#

do you see that?

dim falcon
#

can u vc?

young lagoon
#

this thing

dim falcon
#

i have no clue what that is ngl

young lagoon
#

open explorer

dim falcon
#

all i see is this

young lagoon
#

that's the explorere

#

then you see players, which is already open

dim falcon
#

oh

young lagoon
#

then press the little error next to your name

#

then, press the error next to the map leaderstats

#

then send a screenshot of that in here

dim falcon
#

what error are u talking ab

young lagoon
#

arrow*

#

sorry

dim falcon
#

oh

prisma pulsarBOT
#

studio** You are now Level 3! **studio

young lagoon
#

is there a folder named leaderstats in there?

dim falcon
#

no

young lagoon
#

well there's your issue

#

make sure the code copies leaderstats to the player

#

then also make the sure the code actually places the values inside the copy

#

not inside the folder inside the storage

dim falcon
#

how do i make it copy to the player

young lagoon
#

well now you need to be careful with the declares

#

as we want the copy to not have the same declare as the one in storage

young lagoon
dim falcon
#

how do i know

#

i believe its local

#

this is the code

#

local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

local Template = require(ServerScriptService.PlayerData.Template)
local Manager = require(ServerScriptService.PlayerData.Manager)
local ProfileService = require(ServerScriptService.Libs.ProfileService)

local ProfileStore = ProfileService.GetProfileStore("Production", Template)

local KICK_MESSAGE = "Data Not Found Please Try Again! If This Issue Continues Contact Us!"

local function CreateLeaderStats(player :Player)
local profile = Manager.Profiles[player]
if not profile then return end

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

local clicks = Instance.new("NumberValue", leaderstats)
clicks.Name = "Clicks"
clicks.Value = profile.Data.Clicks

local gems = Instance.new("NumberValue", leaderstats)
gems.Name = "Gems"
gems.Value = profile.Data.Gems

end

local function LoadProfile(player: Player)
local profile = ProfileStore:LoadProfileAsync("Player_"..player.UserId)
if not profile then
player:Kick(KICK_MESSAGE)
return
end

profile:AddUserId(player.UserId)
profile:Reconcile()
profile:ListenToRelease(function()
    Manager.Profiles[player] = nil
    player:Kick(KICK_MESSAGE)
end)

if player:IsDescendantOf(Players) == true then
    Manager.Profiles[player] = profile
    CreateLeaderStats(player)
else
    profile:Release()
end

end

for _, player in Players:GetPlayers() do
task.spawn(LoadProfile, player)
end

Players.PlayerAdded:Connect(LoadProfile)
Players.PlayerRemoving:Connect(function(player)
local profile = Manager.Profiles[player]
if profile then
profile:Release()
end
end)

young lagoon
#

which icon does the script have?

dim falcon
#

localscript

young lagoon
dim falcon
#

oh

#

im using local script tho

young lagoon
#

wait, so it creates the folder inside the code

dim falcon
#

i think

young lagoon
#

and place it inside the player

dim falcon
#

i think so

young lagoon
#

can you test the game and quickly check where in the explorer the folder ends up

dim falcon
#

which folder

young lagoon
#

so just test, then at the top of the explorer it says "filter workspace"

#

then search leaderstats

#

in there

#

it should look a little like this, but with an actual folder inside the gray

dim falcon
#

looks like yours

young lagoon
#

wait

dim falcon
#

fixed it

#

i moved it to a regular script

young lagoon
#

yeah

#

does it work now?

dim falcon
#

yeah

#

ty for the help

young lagoon
#

no problem