Как сделать coin и leaderstats roblox studio

Обновлено: 05.07.2024

У меня вопрос .Надо писать определённый скрипт или придумывать?

Ты не объяснил что означает сам скрипт как пишется вот это все а просто сказал что куда вводить

а можешь скрипт в описании оставить? пожалуйста

кака зделать своё свой пет симулятор
и своё йцо

Привет!Ты покажешь как сделать так что бы сохранялись монеты?

Как сделать так чтобы монета собиралась при нажатии?

Скрипт не работает

А где моделька скрипта?

Все супер круто но кроме одного можешь написать в чате скрипты пжжжжжжжжжжжжжжжж бо там не чего не видно

у меня не работает или я неправильно пишу или твой скрипт просто не работает! А если я не правильно пишу твой скрипт то дай мне его пж скопировать

А была рабочая лампа которую можно включить и выключить?

GameData курс в помощь. На форуме роблокса есть урок по этому

а можно написать в коменте скрипт

А какой первый скрипт напишите пожалуйста

Я всё сделал правильно но не работает

@LisiyBobr Studio ну хз

@SoLLing у меня тоже, строчку в строчку, но ничего не работает

сделал бы все правильно - заработало бы

А чо делать я собираю монети но не добавляэт больше

сложно что ли скрипты оставить в комментариях? или в документ их скопировать что бы люди не мучались,я хочу на быструю руку все сделать но нет приходится переписывать,сложно документы оставлять?!

Согласен + них не видно какой монитор должны быть что-бы снимать в 700p у меня очень хуевый моник и снимает блять в 2k сука

а как сделать так чтобы они сохронялись?

А оно будет совмещяться с командами?

local Players = game:GetService("Players")

Players.PlayerAdded:connect (function(player)
local a =Instance.new("Folder",player)
a.Name = "Leaderstats"
local b =Instance.new("NumberValue",a)
b.Value = 0 --Изначальная сумма денег
b.name = "cash"

end)
Скрипт из видоса)

@ksssuuuul32 не заметно, не заметно.

@Killer я уже довно сделал это и ты мне не помог

@ksssuuuul32 Может научишься писать, Вместо того чтобы скрипты копировать? и вставлять. У меня он работает что у тебя незнаю.

У меня не респавнится монета :/

так сделай свой скрипт

А КАК ЗДЕЛАТЬ ЧТОБЫ КАРТА САЗДАЛАСЬ И ВСЕ В ЕЁ ИГРАЛИ

про это есть отдельные туториалы

Я всë как надо НО НИХУЯ НЕ РАБОТАЕТ Я УЖЕ 3 ЧАСА СИЖУ И ИЩУ ВИДЕО НОРМАЛЬНОЕ

@БогданРоблокс который слышал 2 часа

@DmitrievNikon причём тут это? Просто следи за базаром!

@БогданРоблокс лол сидел почти 2 часа и не чë не понимал

следи за тем что пишеш

У меня кэш и цифры не отображаются

А объясни пожалуйста как сделать чтоб эта валюта сохранялась. Буду ооооченьь благодарна :)

Ты дурак скрипты не работают и монеты не сплющивается безобразие!

Во 1-ых, возьми модель и не пиши в ручную скрипт, во 2-ых, включи API, в 3-их она не должна сплющиваться.

а где сам скрипт?

спасибо оооочень помог. лучше всех объясняешь!!

Второй скрипт у меня не работает

Сделай пожалуйста туториал как тратить эти деньги , например на трейлы

Нужно сделать магазин который будет связан с лидер статс

можете дать скрипт пожалуйста .

@Gelia Ki её там нет

В описании модель со скриптом.

ссылку на скрипт плиз оставь

Скажи как сделать что бы по нажатии по кнопке довались койны, типо которая на экране(

Я нуб в редакции и я тупой

Я пытаюсь создать свой режим

Это риальтно Помогает!

о у меня нет работает прамакот

@Stickman ЗНачит что то не так сделал

монета получает но нет cash?

Как добавить в лидерстатс ещё что то?

Спасибо большое!! Скажи как сделать активные картинки( комп в комнате стоит можешь сесть и тыкать там например) пожалуйста

А как сделать чтоб за эти монетки можно было покупать?

бро , дай ответ пж в виде видоса , вопрос такой у меня , все я сделал с монеткой , но я добавил в парт еще огонь искры туман , кароч монета исчезает , а все добавленое к ней остается , помоги решить это , уже мозг кипит, если не втягость тебе, нужно чтоб все добавленое к монете тоже исчезало сней ну и такойже спавн был обратно , ищу видосы нет ниукого такого /спасибо

Updating Stats

To update a player’s leaderboard stat, simply change the Value property of that stat within their leaderstats folder. For example, the following Script can be attached to any pickup object to increase the Gold stat of whichever player collects it.

In-Game Leaderboards

Roblox has a built-in leaderboard system that lets you display player information like scores, currency, or the fastest time in a race.


Setting Up the Leaderboard Stats

Whenever a player is added to the game, they’ll need to be added to the leaderboard along with code for tracking the individual stats.

  1. In the Explorer, under ServerScriptService, create a new script named PlayerSetup.
  1. Delete Hello World and write a descriptive comment.
  1. After the comment, create a custom function named onPlayerJoin with a parameter named player .
  1. In onPlayerJoin , create a variable named leaderstats , and have it create a new Folder Instance. Naming the folder leaderstats lets Roblox Studio know to create a leaderboard.
  1. Name the new Folder instance leaderstats, and parent it to the player.
Troubleshooting Leaderboards

Make sure that you name the variable and the new instance leaderstats. Without this, Roblox won’t know to create a new leader board.

  1. After the end of the function, connect OnPlayerJoin to the PlayerAdded event. Whenever a player joins the game, the onPlayerJoin function will run.
Don't Test Yet

If you test the project now, you won’t see a leaderboard. This is because the leaderboard doesn’t yet have any stats to display.

Creating a Leaderboard

Players will be able to see important stats like how much gold they have, the number of items in their bag, and the max number of items they can hold by looking at a leaderboard.

Using Leaderboards In Different Ways »

Leaderboards won’t save information between games. If a player leaves a game, they’ll lose any information in their leaderboard.

Adding Stats

Leaderboards use value type objects to store and display player stats. This script will show a player’s gold using an IntValue , a placeholder for an integer.

In the leaderboardSetup() function, add the highlighted code:

These lines accomplish the following:

  1. An IntValue instance is created.
  2. The instance’s Instance/Name|Name is set to Gold. This is exactly how the stat will appear on the in-game leaderboard.
  1. The stat’s initial IntValue/Value|Value is set to 0. This can be set to any value you wish, including a value stored in a /articles/saving data introduction|data store if you’re implementing persistent leaderboards.
Note that value type objects like IntValue , NumberValue , and StringValue must be set through their Value property as in gold.Value = 0 , not by direct declaration as in gold = 0 .
  1. The instance is parented to the leaderstats folder which adds it to the leaderboard. When players enter the game, their names will appear on the board.

Tracking Player Gold

Now that a leaderboard is created, it needs to show the player these numbers:

  • Gold - How much money the player has.
  • Items - How many items the player has collected from the world.
  • Spaces - The most items a player can hold at one time.

Each of these numbers will be an IntValue, a placeholder object for a number.

  1. In OnPlayerJoin, under leaderstats.Parent = player , type local gold = Instance.new("IntValue") .This creates a new IntValue and stores it in the variable gold .
  1. Type gold.Name = "Gold" . This gives the IntValue a name so you can use it in other scripts. The name will also be show up on the leaderboard.
Using Your Own Values »

While this project uses the name “Gold”, students can use other forms of currency that better fit their theme like “Rubies” or “Gems”. To help students remember the exact spelling and names, have them write down the name in quotations on the Adventure Game Cheat Sheet handout.

  1. On a new line, type gold.Value = 0 . This makes it so players don’t start with any gold
Using .Value

While variables are normally changed using = as in myNumber = 10 , an IntValue is changed using its Value property, like myIntValue.Value = 10 .

  1. Type gold.Parent = leaderstats . This parents the IntValue for gold to leaderstats . If the IntValue is not parented to leaderstats , players won’t see it.
  1. Play your game and notice that a leaderboard appears in the top right.
Can't See Your IntValue? »
  • Make sure that .Value is capitalized.
  • Make sure that the variable for the IntValue is parented to the leaderboard like gold.Parent = leaderstats .

Track Player Items and Spaces

  1. Add a blank line after gold.Parent = leaderstats . This makes it easier to see where the code for different IntValues starts and stops.
  2. After the blank line, create a stat for Items by setting up a new IntValue the same way you did for gold.
  1. Create a new stat for the player’s bag spaces. Set spaces.Value to 2 so players start the game only being able to hold two items at once, encouraging them buy a new bag as soon as they can.
  1. Test the game. Players should have a leaderboard showing Gold, Items, and Spaces.
Leaderboard Not Working As Expected?
  • If you can’t see the number on the leaderboard, check that each IntValue is parented to leaderstats.
  • Make sure each IntValue is spelled exactly as shown
  • Check that the PlayerAdded event is at the bottom of the script
Final PlayerSetup Script »

These documents are licensed by Roblox Corporation under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License . Roblox, Powering Imagination, and Robux are trademarks of Roblox Corporation, registered in the United States and other countries.

Edit: Трек поменял, тк могли блокнуть во 80 странах этот ролик.
Всем привет, извиняюсь за долгое отсутствие (были на это причины). Результаты конкурса как я и говорил 20 - 25 мая. И да не будьте злыми мне и так на это видео прилетело авторские права.

@Siter Play 21 может или 22.

@Siter Play Времени мало, завтра если успею то выложу результаты.

Ну и где результаты?)

а как переименовать валюту где?

Почему у меня деньги не прибавляются а наоборот баланс становится как стоимость этой монетки

А ведь можно любую монету брать из тул бокса?

потом изменить можно под себя монету

главное чтобы виручув небыло

Я делаю первый раз и нифига не понятно(((

А как сделать без респавна монеты покажи пожалуйста не могу сделать(

Я хз не помню, я вроде отдельно делал распавн скрипт, удали просто его или где написано время до распавна, напиши очень много чисел и все.

Вот например я эти скрипты и мэш перевел в блок, а почему потом у меня не сравнится снова? Я собираю блок потом он не появляется.. Помогите пж

Попробуй ещё раз, должно работать.

НЕ РАБОТАЕТ НЕ РЕСПАВН НЕ ЗВУК!!

Не может не работать, темболее такой простой скрипт. Значит ты что-то не то сделал.

Ребят помогите как зделать окно чтоб открывалось и закрывалось как в играх магазин

А что делать если ты перезаходишь и у тебя обнуленеие?

говно они видео как сделать чтобы всё было в одной валюте я делаю симулятор а там 2 валюты мне нужно чтобы люди не нажимали я видел в разных симуляторах деньги в одной валюте а тут целых 2 валюты

@Vladuhad9 А у меня так не сработало, почему?

Тк поменяй в скрипте слово "Coins", на свою валюту. В чём проблема? Это настолько трудно?

Почему у меня не пишеться сколько коинов у меня

А как сделать рандомный спавн на определённой территории ??

@Алекс Роблокс Спасибо)

Вот:
local generate = math.random(1,10)
if generate = 1 then
script.Parent.Position = "сюда вписать позицию"
elseif generate = 2 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 3 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 4 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 5 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 6 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 7 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 8 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 9 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
elseif generate = 10 then
script.Parent.Position = "Сюда вписать кординаты которые захочешь"
end

спасибо я сделал с помощью этого свой симулятр и вип зону и теперь у меня уже 2590 робуксов кто не верит ник DimkaTop554

@RobDel Game во вторых на такое жалобы не подают. Да и нет такой жалобы "не адекватный"

@RobDel Game это раз

@RobDel Game хахах. И че ты мне сделаешь. И причём здесь не адекват.? Про себя что ли

Leaderboard Setup

Whenever a player enters the game, they should be added to the leaderboard. This can be done as follows:

  1. Create a new Script within ServerScriptService .
  1. In the script, connect a function to the Players/PlayerAdded|PlayerAdded event.
  1. Inside the connected function, create a new Folder instance, name it leaderstats, and parent it to the player.
It's essential that the folder is named leaderstats (all lowercase). Roblox won't add the player to the leaderboard if any other name variation is used.

Читайте также: