print("Hello, World!")
1 year ago
Ukraine

Hello, World!

skorostt нравится это
Russia

Ivanych gandon

Łódzkie, Poland

-- DataStoreService to handle data saving/loading

local DataStoreService = game:GetService("DataStoreService")

local playerData = DataStoreService:GetDataStore("PlayerData")

-- Function to handle player joining

game.Players.PlayerAdded:Connect(function(player)

-- Create a leaderstats folder to hold player data

local leaderstats = Instance.new("Folder")

leaderstats.Name = "leaderstats"

leaderstats.Parent = player



-- Create a currency value to hold player's coins

local coins = Instance.new("IntValue")

coins.Name = "Coins"

coins.Parent = leaderstats



-- Load player data from DataStore

local success, data = pcall(function()

    return playerData:GetAsync(player.UserId)

end)



-- Check if data was successfully retrieved

if success and data then

    coins.Value = data.Coins or 0

else

    -- Default value if no data is found or retrieval failed

    coins.Value = 0

end

end)

-- Function to handle player leaving

game.Players.PlayerRemoving:Connect(function(player)

-- Get the player's data to save

local leaderstats = player:FindFirstChild("leaderstats")

if leaderstats then

    local coins = leaderstats:FindFirstChild("Coins")

    if coins then

        -- Save player data to DataStore

        local success, err = pcall(function()

            playerData:SetAsync(player.UserId, {

                Coins = coins.Value

            })

        end)

        -- Error handling

        if not success then

            warn("Failed to save data for player " .. player.Name .. ": " .. err)

        end

    end

end

end)

-- Function to periodically save data for all players

while true do

wait(60) -- Save data every 1 minute

for _, player in pairs(game.Players:GetPlayers()) do

    -- Get the player's data to save

    local leaderstats = player:FindFirstChild("leaderstats")

    if leaderstats then

        local coins = leaderstats:FindFirstChild("Coins")

        if coins then

            -- Save player data to DataStore

            local success, err = pcall(function()

                playerData:SetAsync(player.UserId, {

                    Coins = coins.Value

                })

            end)

            -- Error handling

            if not success then

                warn("Failed to save data for player " .. player.Name .. ": " .. err)

            end

        end

    end

end

end

Russia

Denied

Ind​ianapolis, IN, USA

what

skorostt и KalvishLV нравится это
Russia

Go naxuy

PROGUM1234
Any/All, He/Him, She/Her, They/Them, It/Its
1 year ago

hhhh

PROGUM1234
Any/All, He/Him, She/Her, They/Them, It/Its
1 year ago

bbbb

äctüällÿ shüt lüh fück üp hölÿ shït döwngrädëd mf

PROGUM1234
Any/All, He/Him, She/Her, They/Them, It/Its
1 year ago

next person to speak here is gay and heavily autistic

png69 и KalvishLV нравится это
New Zealand
ПодтверждающийMichaelMaestro
He/Him, She/Her, They/Them
11 months ago

yea

skorostt нравится это
Ind​ianapolis, IN, USA

these randoms

skorostt нравится это
Russia
Удалено пользователем автор
Ukraine

isle

skorostt нравится это
Russia
Удалено пользователем автор
Статистика игры
Подписчики
318
Времена
1,575
Игроки
455
Последние новости
60 FPS Rule Enforcement

Hello Prominent Speedish Goated Fast Runners.

A discussion inside council has resulted in us believing the display of FPS is more necessary than ever. Keep in mind 60 fps is the limit on runs that aren't Limitless. You can only use in-built methods of displaying the FPS such as the Shift+F5 men

9 months ago
Последние темы
Опубликовано 6 months ago
games:thread_reply_count
Опубликовано 1 month ago
games:thread_reply_count
Опубликовано 6 months ago
games:thread_reply_count
Опубликовано 6 months ago
games:thread_reply_count
Опубликовано 7 months ago
games:thread_reply_count
Опубликовано 8 months ago
games:thread_reply_count