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

How can i have 2 "Currency" leaderstats at once?

Asked by 1 year ago

I wanted to make a christmas event and make another leaderstat: "Gifts". I tried separating them into 2 different scripts, but if i change the coin.name to Gifts then it would just change the entire coin currency into Gifts.

0
could you please send your leaderstats script Samcek_God234 9 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago

Try this:

-- Declare the leaderstats and set their initial values to 0 local leaderstats = Instance.new("Folder") leaderstats.Name = "Leaderstats"

local coins = Instance.new("IntValue") coins.Name = "Coins" coins.Parent = leaderstats coins.Value = 0

local gifts = Instance.new("IntValue") gifts.Name = "Gifts" gifts.Parent = leaderstats gifts.Value = 0

-- Add the leaderstats to the player's character leaderstats.Parent = game.Players.LocalPlayer.Character

Ad

Answer this question