Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Is it possible to make an in-game stats gui? [closed]

Asked by 10 years ago

Is it possible to make an in-game stats gui? For example, showing how many kills you have. The KDR, and the team which is winning or losing?

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

3 answers

Log in to vote
1
Answered by 10 years ago

Sure it is.

game.Players.PlayerAdded:connect(function(Player)
    local LS = Instance.new("IntValue", Player) -- LS = leaderstats
    LS.Name = "leaderstats"
    local Kills = Instanc.e.new("IntValue", LS) -- (ClassName, Parent)
    local Kills.Name = "Kills"
    local Deaths = Instance.new("IntValue", LS)
    Deaths.Name = "Deaths"
end)

now in a ScreenGui add a script and a textlabel

local Player = game.Players.LocalPlayer
local Stats = Player.leaderstats
local Kills = Stats.Kills
local Deaths = Stats.Deaths
local KDR = ( Kills.Value / Deaths.Value )
local TL = script.Parent.TextLabel
local Team1 = game.Teams.Team1
local Team2  = game.Teams.Team2

while wait() do
    if Team1.Score > Team2.Score then
    TL.Text = "K/D: " .. tostring(KDR) .. " Winning Team:  "..Team1.Name
    elseif Team2.Score > Team1.Score then
    TL.Text = "K/D: " .. tostring(KDR) .. " Winning Team:  "..Team2.Name
    end
end
0
1 game.Players.PlayerAdded:connect(function(Player) 2 local LS = Instance.new("IntValue", Player) -- LS = leaderstats 3 LS.Name = "leaderstats" 4 local Kills = Instanc.e.new("IntValue", LS) -- (ClassName, Parent) 5 local Kills.Name = "Kills" 6 local Deaths = Instance.new("IntValue", LS) 7 Deaths.Name = "Deaths" 8 end) Where do i put this? in a script in workspace? Thank you AlanLogic 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Yes, it is possible to do. You would have to save their stats somehow and just display it in GUI form.

0
Do you know how to do thtt? AlanLogic 0 — 10y
0
For you, no. You would have to get the weapons you have to save their stats to the player and then have datastore save them. I might do it a different way than you would, so I would say I can help if you learn slowly along the way but I cannot just tell you or you won't learn. BornLeader1 5 — 10y
Log in to vote
0
Answered by 10 years ago

You could insert BoolValue to handle the Kills and Death, and get them through a LocalScript, and display them through a TextLabel. It would be moderately challenging, but not impossible.