Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

How to make a COIN SYSTEM | Roblox Studio Tutorial

Автор: Itz_FloppyFish

Загружено: 2023-12-23

Просмотров: 50271

Описание:

In todays video I show you how to make an entire coin system in Roblox Studio! This type of system can be used in multiple ways, Either simply for coins or any type of system which includes the players leaderstat value increasing! In this tutorial we go over the datasaving part aswell as 2 ways on how you can make a coin which gives the player the currency work. if you did want this type of feature in your game make sure to watch to the end of the video to find out how!

I really enjoy making these videos for you all so I hope you enjoy them just as much as I do!
Have a lovely rest of your day!

Script 1 (DataSavingScript)

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local DatastoreService = game:GetService("DataStoreService")
local Data = DatastoreService:GetDataStore("2")
local sessionData = {}

function PlayerAdded(player)
local coins = Instance.new("NumberValue")
coins.Name = "Coins" -- Change Coins to whatever your currency is called.
coins.Parent = player

local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

coins.Parent = leaderstats

local success, playerData = pcall(function()
return Data:GetAsync(player.UserId)
end)

if success then
print("Data loaded: " .. player.Name)

if not playerData then
print("New player, giving default data")

playerData = {
["Coins"] = 0, -- Change Coins to whatever your currency is called.
}
end

sessionData[player.UserId] = playerData
else
warn("Couldn't load data: " .. player.Name)
player:Kick("Couldn't load your data, rejoin")
end

coins.Value = sessionData[player.UserId].Coins -- Change Coins to whatever your currency is

coins:GetPropertyChangedSignal("Value"):Connect(function()
sessionData[player.UserId].Coins = coins.Value -- Change Coins to whatever your currency is
end)
end

Players.PlayerAdded:Connect(PlayerAdded)

function PlayerLeaving(player)

if sessionData[player.UserId] then

local success, errorMsg = pcall(function()
Data:SetAsync(player.UserId, sessionData[player.UserId])
end)

if success then
print("Data saved: " .. player.Name)
else
warn("Can't save: " .. player.Name)
end
end
end

Players.PlayerRemoving:Connect(PlayerLeaving)

function ServerShutdown()
if RunService:IsStudio() then
return
end


for _, player in ipairs(Players:GetPlayers()) do
task.spawn(function()
PlayerLeaving(player)
end)
end
end

game:BindToClose(ServerShutdown)

-----------------------

Script 2, System one (Part doesnt move) :

local CoinsAdded = 1 -- Change the number to adjust how much you want the player to receive each time
local RespawnTime = 5 -- Change the number to adjust how often you want the coin to respawn
local Debounce = false

script.Parent.Touched:Connect(function(touched)
if Debounce then
return
end

local Player = game.Players:GetPlayerFromCharacter(touched.Parent)
if Player then
local Leaderstats = Player:FindFirstChild("leaderstats")
local Coins = Leaderstats and Leaderstats:FindFirstChild("Coins") -- Change coins to whatever your currency is called which you want the values to add onto

if Coins then
Debounce = true
Coins.Value = Coins.Value + CoinsAdded
script.Parent.Transparency = 1
wait(RespawnTime)
script.Parent.Transparency = 0
Debounce = false
end
end
end)

-----------------------

Script 3, System 2 (With coin random spawning) :

Can be found in the comments! Because ive reached the word limit for this description!

-- Made with love by Floppy

---------------------

If you are a bit confused what to do, Feel free to create a ticket in my discord server and we can help you out!

NEW! Floppys Obby Game : https://www.roblox.com/games/14917960...

Floppys Simulator Game: https://www.roblox.com/games/13963457...

FloppyFish Merch Store: https://itz-floppyfish.creator-spring...

If you would like to support me even more, Super Thanks and becoming a Member is also another way to show your appreciation!

🌟 Floppys Discord Server:   / discord  
🌟 Floppys Roblox Game : https://www.roblox.com/games/11301003...

Roblox Studio Tutorial
Roblox Studio
Studio Tutorials

How to make a COIN SYSTEM | Roblox Studio Tutorial

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

😢ДЕНЬ РОЖДЕНИЯ, ЗАКОНЧИВШЕЕСЯ НАСТОЯЩИМ УЖАСОМ!

😢ДЕНЬ РОЖДЕНИЯ, ЗАКОНЧИВШЕЕСЯ НАСТОЯЩИМ УЖАСОМ!

ROBLOX ЗАБЛОКИРОВАЛИ В РОССИИ

ROBLOX ЗАБЛОКИРОВАЛИ В РОССИИ

Can 6 DEVS Make a SURVIVAL Game Without Communicating?

Can 6 DEVS Make a SURVIVAL Game Without Communicating?

ChatGPT против Gemini: создайте Geometry Dash с нуля

ChatGPT против Gemini: создайте Geometry Dash с нуля

ВСЁ_ВСЁ_ВСЁ О СКРИПТАХ / Уроки по Roblox Studio от Mixmaxed

ВСЁ_ВСЁ_ВСЁ О СКРИПТАХ / Уроки по Roblox Studio от Mixmaxed

Путин обратился к армии Украины || Открытие второго фронта?

Путин обратился к армии Украины || Открытие второго фронта?

Визуальный шум в игровых интерфейсах

Визуальный шум в игровых интерфейсах

ЛУЧШИЙ ОБХОД БЛОКИРОВКИ в РОССИИ (ТЕЛЕФОН и КОМП) | Блокировка Роблокс | Как поиграть в РОБЛОКС.

ЛУЧШИЙ ОБХОД БЛОКИРОВКИ в РОССИИ (ТЕЛЕФОН и КОМП) | Блокировка Роблокс | Как поиграть в РОБЛОКС.

Как создать систему диалогов NPC в Roblox Studio

Как создать систему диалогов NPC в Roblox Studio

Роблокс - Заблокировали.. (Это Конец?)

Роблокс - Заблокировали.. (Это Конец?)

ROBLOX STUDIO  для новичков! | Обзор

ROBLOX STUDIO для новичков! | Обзор

ВОЙНА ЗАКОНЧИТСЯ? БОНДАРЕНКО, ШЕВЧЕНКО, ЩЕЛИН

ВОЙНА ЗАКОНЧИТСЯ? БОНДАРЕНКО, ШЕВЧЕНКО, ЩЕЛИН

КАК ДЕЛАТЬ ЛУЧШИЕ АНИМАЦИИ В ROBLOX STUDIO

КАК ДЕЛАТЬ ЛУЧШИЕ АНИМАЦИИ В ROBLOX STUDIO

Что можно делать в VRChat | 27 локаций от эксперта

Что можно делать в VRChat | 27 локаций от эксперта

ROBOX TIKTOKS GOT WORSE...

ROBOX TIKTOKS GOT WORSE...

Роблокс Заблокировали..

Роблокс Заблокировали..

Могу ли я создать ВИРУСНУЮ игру Roblox с помощью ИИ?

Могу ли я создать ВИРУСНУЮ игру Roblox с помощью ИИ?

HOW TO MAKE A MAIN MENU 🛠️ Roblox Studio Tutorial

HOW TO MAKE A MAIN MENU 🛠️ Roblox Studio Tutorial

What If YOU Owned Roblox?

What If YOU Owned Roblox?

How to make a GAMEPASS Button | Roblox Studio Tutorial

How to make a GAMEPASS Button | Roblox Studio Tutorial

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]