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

Why is my stats creator script not working?

Asked by 8 years ago

There seems to be no errors, but the stats do not show up inside of my players backpack. Why?

p = game.Players.LocalPlayer
game.Players.PlayerAdded:connect(function(player)
     local g = Instance.new("Model")
    g.Parent = p.Backpack
    g.Name = "stats"
    wait(1)
if p.Backpack.stats ~= nil then
    local mt = Instance.new("IntValue")
    mt.Parent = p.Backpack.stats
    mt.Name = "magictype"
    local mlvl = Instance.new("IntValue")
    mlvl.Parent = p.Backpack.stats
    mlvl.Name = "mainlvl"
    local meleelvl = Instance.new("IntValue")
    meleelvl.Name = "meleelvl"
    meleelvl.Parent = p.Backpack.stats
    local rlvl = Instance.new("IntValue")
    rlvl.Name = "rangelvl"
    rlvl.Parent = p.Backpack.stats
    local alvl = Instance.new("IntValue")
    alvl.Name = "agilitylvl"
    alvl.Parent = p.Backpack.stats
    local experience = Instance.new("IntValue")
    experience.Name = "exp"
    experience.Parent = p.Backpack.stats
    local hlvl = Instance.new("IntValue")
    hlvl.Name = "healthlvl"
    hlvl.Parent = p.Backpack.stats
    local aclvl = Instance.new("IntValue")
    aclvl.Name = "accuracylvl"
    aclvl.Parent = p.Backpack.stats
    local elvl = Instance.new("IntValue")
    elvl.Name = "endurancelvl"
    elvl.Parent = p.Backpack.stats
    local ken = Instance.new("IntValue")
    ken.Name = "ken"
    ken.Parent = p.Backpack.stats
    local reputation = Instance.new("IntValue")
    reputation.Name = "reputation"
    reputation.Parent = p.Backpack.stats
end
end)

Answer this question