-
What do you want to achieve?
i want to make a kill counter for my billboard gui displaying the kill on the overhead when a player is killed and when the player dies it resets to 0 perhaps i’ve managed to make the script for leaderstats that works fine but i dont know how to implement that script to the overhead one -
What is the issue? Include screenshots / videos if possible!
i dont know how to implement on the overhead of the player -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i have made the script successfully for leaderstats but i dont know how to implement on the overhead of the player
thats the overhead so basically i want the Textlabel.Text inside it to change to the number of kills
local DSS = game:GetService("DataStoreService"):GetDataStore("Kills")
game.Players.PlayerAdded:Connect(function(player)
local key = player.UserId.."-Kills"
local ls = Instance.new("Folder", player)
ls.Name = "leaderstats"
local Kills = Instance.new("NumberValue", ls)
Kills.Name = "Kills"
local data
pcall(function()
data = DSS:GetAsync(key)
end)
if data then
Kills.Value = data[1]
else
Kills.Value = 0
end
player.CharacterAdded:Connect(function(char)
char.Humanoid.Died:Connect(function()
local creator = char.Humanoid:FindFirstChild("creator")
if creator and creator.Value then
local plrkilled = creator.Value
local KillsValue = plrkilled.leaderstats.Kills
KillsValue.Value = KillsValue.Value + 1
end
end)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
local key = player.UserId.."-Kills"
DSS:SetAsync(key, {player.leaderstats.Kills.Value})
DSS:RemoveAsync(key) -- Remove the player's data from the data store
end)
this is the script that that does exact the same on leaderstats but i dont know how to implement it for my billboard gui overhead , any help would be greatly appreciated