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

Why leaderstats aren't working on online?

Asked by 7 years ago
Edited 7 years ago
01local Humanoid = script.Parent.Enemy
02function PwntX_X()
03local tag = Humanoid:findFirstChild("creator")
04    if tag ~= nil then
05        if tag.Value ~= nil then
06local Leaderstats = tag.Value:findFirstChild("leaderstats")
07            if Leaderstats ~= nil then
08Leaderstats.Kills.Value = Leaderstats.Kills.Value + 1
09wait(10)
10script:remove()
11            end
12        end
13    end
14end
15Humanoid.Died:connect(PwntX_X)
0
On line 6, there's no "findFirstChild" it should be "FindFirstChild" popeeyy 493 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

On line 3 and 6 you've done it as 'findFirstChild'. You're supposed to do it as FindFirstChild.

1local tag = Humanoid:FindFirstChild("creator") -- line 3 issue
2 
3local Leaderstats = tag.Value:FindFirstChild("leaderstats") -- line 6 issue
Ad

Answer this question