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

"Player is not a valid member of DataModel?"

Asked by 8 years ago

I don't know what this means

wait(5)
game.Player.PlayerAdded:connect(function(Player)
local stats = Instance.new("IntValue", Player)
stats.Name = "stats"
local Hat = Instance.new("NumberValue", stats)
Hat.Name = "Hat"
local Shirt = Instance.new("NumberValue", stats)
Shirt.Name = "Shirt"
local Pants = Instance.new("NumberValue", stats)
Pants.Name = "Pants"
wait()
Hat.Value = math.random(1,5)
Shirt.Value = math.random(1,5)
Pants.Value = math.random(1,5)

if Hat.Value == 1 then
    local Hat1 = game.ServerStorage.Hair:findFirstChild("Hair1")
    local Hat1Clone = Hat1:clone()
    Hat1Clone.Parent = Player
elseif Hat.Value == 2 then
    local Hat2 = game.ServerStorage.Hair:findFirstChild("Hair2")
    local Hair2Clone = Hat2:clone()
    Hair2Clone.Parent = Player
elseif Hat.Value == 3 then
    local Hat3 = game.ServerStorage.Hair:findFirstChild("Hair3")
    local Hair3Clone = Hat3:clone()
    Hair3Clone.Parent = Player
elseif Hat.Value == 4 then
    local Hat4 = game.ServerStorage.Hair:findFirstChild("Hair4")
    local Hair4Clone = Hat4:clone()
    Hair4Clone.Parent = Player
elseif Hat.Value == 5 then
    local Hat5 = game.ServerStorage.Hair:findFirstChild("Hair5")
    local Hair5Clone = Hat5:clone()
    Hair5Clone.Parent = Player
end

if Shirt.Value == 1 then
    local Shirt1 = game.ServerStorage.Shirt:findFirstChild("Shirt1")
    local Shirt1Clone = Shirt1:clone()
    Shirt1Clone.Parent = Player
elseif Shirt.value == 2 then
    local Shirt2 = game.ServerStorage.Shirt:findFirstChild("Shirt2")
    local Shirt2Clone = Shirt2:clone()
    Shirt2Clone.Parent = Player
elseif Shirt.value == 3 then
    local Shirt3 = game.ServerStorage.Shirt:findFirstChild("Shirt3")
    local Shirt3Clone = Shirt3:clone()
    Shirt3Clone.Parent = Player
elseif Shirt.value == 4 then
    local Shirt4 = game.ServerStorage.Shirt:findFirstChild("Shirt4")
    local Shirt4Clone = Shirt4:clone()
    Shirt4Clone.Parent = Player
elseif Shirt.value == 5 then
    local Shirt5 = game.ServerStorage.Shirt:findFirstChild("Shirt5")
    local Shirt5Clone = Shirt5:clone()
    Shirt5Clone.Parent = Player
    end 
end)
0
it's Players, not Player theCJarmy7 1293 — 8y
0
where? User#12423 0 — 8y
0
line 2 theCJarmy7 1293 — 8y
0
game.Players.PlayerAdded theCJarmy7 1293 — 8y
View all comments (2 more)
0
game.Players.PlayerAdded. Link150 1355 — 8y
0
Thanks! User#12423 0 — 8y

Answer this question