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
local Humanoid = script.Parent.Enemy
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
    if tag ~= nil then 
        if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
            if Leaderstats ~= nil then 
Leaderstats.Kills.Value = Leaderstats.Kills.Value + 1
wait(10)
script:remove()
            end 
        end 
    end 
end 
Humanoid.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.

local tag = Humanoid:FindFirstChild("creator") -- line 3 issue

local Leaderstats = tag.Value:FindFirstChild("leaderstats") -- line 6 issue
Ad

Answer this question