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

It is possible to add a data on leaderstats using instance.new?

Asked by 2 years ago

I have a problem, I am using a system with an inbuilt leaderstats however I can't find we're exactly do I have to put a new data... i tried using a find on script but I can't since a lot of similar pop up on it. Now I'm planning to make a new data using a separate script. It is possible? Then if yes what script do I have to use, a local script or script? What about the instance.new(what to put here?)

1 answer

Log in to vote
0
Answered by 2 years ago

If you're trying to use leaderstats and add data, you would indeed use Instance.new to insert values into it. For an example,

local Cash = Instance.new("NumberValue",leaderstats)
Cash.Name = "Cash"
Cash.Value = 50

That code would allow a number to be stored in leaderstats, which shows in the right hand corner on the leaderboard with the name "Cash", and a value of 50 Most if not all values should work, such as StringValue, BooleanValue or IntValue

0
It is okay to use a separate script? AltairCelestia 47 — 2y
0
What does the leaderstats on the firstline mean? It is to tell that the data is leadertat? AltairCelestia 47 — 2y
0
The leaderstats in instance.new indicates the parent of the numbervalue. CocoDysphoria 67 — 2y
Ad

Answer this question