-
i need this code to be able to show the other stats to the board. and the board name is called “func” btw in the top of the code. where all stats are suppose to show and it does work but just not other stats?
-
some reason when i run the code it works fine, But some odd reason only the stats Highest Wins and Highest Spree and the tier are the only ones showing on the board. Value wise. and the values of the other stats are there BUT are not showing on the surfacegui like the rest, i can not figure out why
-
i tried multiple ways and even asked friends and a advanced script bot. Nothing seems to work…
local Part = script.Func
Part.Parent = workspace
wait(1)
local Key = workspace._DataStoreKey
local DS_Wins = "ds_wins".. Key.Value
local DS_Spree = "ds_spree".. Key.Value
local DS_Other = "ds_other".. Key.Value
local Players = game.Players
local Gui = Part.SurfaceGui
local List = Gui.ScrollingFrame
local Page = Gui.Page
local ReplicatedStorage = game.ReplicatedStorage
local function LoadPage(Player)
local Bust = ReplicatedStorage.LocalBoardRemotes.GetBust:InvokeServer(Player.UserId)
Page.ImageLabel.Image = Bust
local leaderstats = Player.HiddenStats
local SavedWins = leaderstats.HighestWins.Value
if SavedWins then
Page.HighestWins.Text = "Highest Wins: ".. SavedWins
else
Page.HighestWins.Text = "Highest Wins: 0"
end
local SavedSpree = leaderstats.HighestSpree.Value
if SavedSpree then
Page.HighestSpree.Text = "Highest Spree: ".. SavedSpree
local tier = math.floor(SavedSpree/10) + 1
Page.ImageLabel.Tier.Text = "Tier ".. tier
else
Page.HighestSpree.Text = "Highest Spree: 0"
Page.ImageLabel.Tier.Text = "Tier 0"
end
local SavedOther = ReplicatedStorage.LocalBoardRemotes.GetData:InvokeServer(DS_Other, Player.UserId) or {leaderstats}
if SavedOther[2] then
Page.TotalWins.Text = "Total Wins: ".. SavedOther[2]
else
Page.TotalWins.Text = "Total Wins: 0"
end
if SavedOther[3] then
Page.Deaths.Text = "Deaths: ".. SavedOther[3]
else
Page.Deaths.Text = "Deaths: 0"
end
if SavedOther[3] > 0 then
Page.KDR.Text = "KDR: ".. SavedOther[2]/SavedOther[3]
else
Page.KDR.Text = "KDR: 0"
end
if SavedOther[4] then
Page.ArenaWins.Text = "Arena Wins: ".. SavedOther[4]
else
Page.ArenaWins.Text = "Arena Wins: 0"
end
end
local function Update()
for _,v in pairs(List:GetChildren()) do
if v:IsA("TextButton") then
v:Destroy()
end
end
for _,v in pairs(Players:GetChildren()) do
local Button = script.TextButton:Clone()
Button.Text = v.Name
Button.Parent = List
Button.MouseButton1Down:Connect(function()
Update()
LoadPage(v)
Page.Visible = true
end)
end
end
Players.PlayerAdded:Connect(function() wait(1) Update() end)
Players.PlayerRemoving:Connect(function() wait(1) Update() end)
while task.wait(1) do
Update()
end