#Leaderstats access

1 messages · Page 1 of 1 (latest)

dusk elk
#

Is there a way to access something within the leader stats folder I tried game.Players.player.leaderstats.Money and it can't find it

lethal vine
#

It is local script right?

#

If so the its game.Players.LocalPlayer

#

And you have to make it yourself

#

In a script

dusk elk
#

Im aware but I'm accessing it in a different script

lethal vine
#

You are accesing the player right? Not the character?

dusk elk
#

Yes

lethal vine
#

Can you show me the script in a ss

#

im mobile

dusk elk
#

What of the script do you need

#

@lethal vine

lethal vine
#

The one that detects the folder

dusk elk
#

money is an int value

steep sand
# dusk elk

you can just get it the same way you did in the other script

dusk elk
steep sand
dusk elk
steep sand
pulsar sigilBOT
#

studio** You are now Level 10! **studio

steep sand
#

💔

dusk elk
dusty flax
#

You want to change the Money value?

steep sand
#

leaderstats without knowing what a variable is

#

variables are basically ways of organising code or like an object into 1 piece of text

#

for example

dusk elk
#

Ohh yeah I knew that

#

But I did define it as a variable and it can't be found

steep sand
#

ah shitt

dusty flax
dusk elk
#

Sorry if I'm just really dumb 😔

steep sand
#

local Players = game:GetService(“Players”)
local Plr = Players.LocalPlayer
local MoneyStat = player:WaitForChild("leaderstats"):WaitForChild("Money")

steep sand
#

.touched needs to be done on the client

#

update the leaderstat on the server with remote events

dusty flax
#
local Players = game:GetService("Players")
local Money = Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Money")
if not Money then
    print("Unable to find the Money stats in the LocalPlayer.")
end
#

Also this needs to be in a localscript if not already done

steep sand
#

repeated what i already sent

#

just didnt put it in lua font

#

💔🙏

dusty flax
#

didn't see

steep sand
#

sometimes if you dont it will run with nothing there so will return nil

dusk elk
granite nova