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

Um so basically how do i make it so that the leaderstats doesnt show but it stores the value ?

Asked by 3 years ago

local Players = game.Players

local Template = Instance.new 'BoolValue' Template.Name = 'leaderstats'

Instance.new('IntValue', Template).Name = "Kills" Instance.new('IntValue', Template).Name = "Deaths"

Players.PlayerAdded:connect(function(Player) wait(1) local Stats = Template:Clone() Stats.Parent = Player local Deaths = Stats.Deaths Player.CharacterAdded:connect(function(Character) Deaths.Value = Deaths.Value + 1 local Humanoid = Character:FindFirstChild "Humanoid" if Humanoid then Humanoid.Died:connect(function() for i, Child in pairs(Humanoid:GetChildren()) do if Child:IsA('ObjectValue') and Child.Value and Child.Value:IsA('Player') then local Killer = Child.Value if Killer:FindFirstChild 'leaderstats' and Killer.leaderstats:FindFirstChild "Kills" then local Kills = Killer.leaderstats.Kills Kills.Value = Kills.Value + 1 end return -- Only one player can get a KO for killing a player. Not 2, not 3. Only one. end end end) end end) end)

this is the code how to make it so that it stores the value without leaderstats showing

0
Please format your code to be viewed correctly! SpectacularPavlos 86 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

make the folder 'leaderstats' just 'stats' or a different name. you would need to change how you get there but it wont show up on the playerlist. or you could just set it in the data. I think its updateasync or setasync. I would just use profileservice so it auto updates in the data.

0
Got Discord? KwobTwelb 2 — 3y
0
Got Discord? KwobTwelb 2 — 3y
0
yes BulletproofVast 1033 — 3y
Ad

Answer this question