so me and my friend tried making a sword fighting game, and i decided to make a leaderstats for KOs and Wipeouts. I'm really new to coding but i've done leaderstats before and they worked pretty much fine. this script however doesnt, and it didnt give me any errors. so i dont know what to do
script. game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local kos = Instance.new("Folder")
kos.Name = "KOs"
kos.Parent = plr
local wo = Instance.new("Folder")
wo.Name = "Wipeouts"
wo.Parent = plr
plr.CharacterAdded:Connect(function(char)
local humanoid
repeat
humanoid = char:FindFirstChild("Humanoid")
wait()
until humanoid
humanoid.Died:Connect(function()
wo.Value = wo.Value + 1
local tag = humanoid:FindFirstChild("creator")
if tag then
local killer = tag.Value
if killer then
killer.leaderstats.kos.Value = killer.leaderstats.kos.Value + 1
end
end
end)
end)
end)

5 comments
Do not think that just because you post a question, then paste your code, doesn't mean we already know the context. Context is important and it will benefit you.
ur right, so me and my friend tried making a sword fighting game, and i decided to make a leaderstats for KOs and Wipeouts. I'm really new to coding but i've done leaderstats before and they worked pretty much fine. this script however doesnt, and it didnt give me any errors. so i dont know what to do
I see the problem. Edit your question to include the description.
what is the problem?
I posted an answer.