Город МОСКОВСКИЙ
00:04:53

HOW TO MAKE LEADERSTATS SHOW ON A GUI ?️ Roblox Studio Tutorial

Аватар
Геймеры и Средневековье
Просмотры:
43
Дата загрузки:
29.10.2023 19:42
Длительность:
00:04:53
Категория:
Видеоигры

Описание

In todays video I show you how to make a Part or a Item give you currency (Cash or Coins) when the item is touched, this script includes a data store, meaning if a player leaves the game the data saves and when they rejoin they will have the same amount of currency before they left. I Hope you enjoyed the video, Have a lovely rest of your day!
If you are a bit confused what to do, Feel free to message me on Discord and Ill help you out!

? Floppys Discord Server: https://discord.gg/Vq2msxnR95

Script 1 (Leaderstats Script) :

game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local Coin = Instance.new("IntValue")
Coin.Name = "Coins" -- Change this to what you want the leaderstat name to be
Coin.Value = 0
Coin.Parent = leaderstats
end)


Script 2 (GUI local Script) :

local CoinsLabel = script.Parent

local function onCoinsChanged(newValue)
CoinsLabel.Text = "Coins: " .. tostring(newValue) -- Change "Coins" to whatever you want your currency to be called
end

local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
local Coins = leaderstats:WaitForChild("Coins")
onCoinsChanged(Coins.Value)

Coins.Changed:Connect(function(newValue)
onCoinsChanged(newValue)
end)


? Floppys Roblox Game : https://www.roblox.com/games/11301003...

Roblox Studio Tutorial
Roblox Studio
Studio Tutorials

Рекомендуемые видео