0

# How to change values of leaderstats in a public script?

I am having issues getting access to a players leaderstats folder, I have tried PlayerAdded but that will only run once and I am using while true do loops to update their information, not the best way of doing it and especially not now since I ran into a problem and having to work backwards from my code, I feel like I have to use a localscript but that wont update for other peoples perspectives. If you can direct me in the right direction that would be greatly appreciated <3.

0
sO_Ov 275
8 days ago

I don't understand what is exactly your problem, but here's example of how you can access a specific folder and change values inside her

local Players = game:GetService("Players")

--// Handling Joined event and creating folder
--//Creating Instances
local Folder = Instance.new("Folder")
Folder.Parent = plr

local Value = Instance.new("NumberValue")
Value.Name = 'Cash'
Value.Parent = Folder
end)