#Add Leaderstats to the gui to Replicate

1 messages · Page 1 of 1 (latest)

golden ibex
#

Hello i want to make it so the leader stats "Time Survived" and "Wins" replicate on the gui so if i add 2 wins on leader stats it would say wins: 2

heady nest
#

Wheres ur code did u even try

golden ibex
# heady nest Wheres ur code did u even try

local player = game.Players.LocalPlayer

local guiFrame = script.Parent
local winsLabel = guiFrame:WaitForChild("WinBox")
local timeLabel = guiFrame:WaitForChild("Timebox")

local intermissionTime = 120
local roundTime = 120

local function updateWins()
local wins = player:FindFirstChild("Wins")
if wins then
winsLabel.Text = "Wins: " .. wins.Value
end
end

while true do

for i = intermissionTime, 0, -1 do
    timeLabel.Text = "Next Round Starting in " .. i
    updateWins()
    wait(1)
end

timeLabel.Text = "Round Started"

local timeSurvived = 0
while timeSurvived < roundTime do
    wait(1)
    timeSurvived += 1
    timeLabel.Text = "Time Survived: " .. timeSurvived

    
    local stat = player:FindFirstChild("Time Survived")
    if stat then
        stat.Value = timeSurvived
    end
end

end

heady nest
ripe relic
#

yes do leaderstats.Wins.Changed

golden ibex
ripe relic
#

bruh