game.Players.PlayerAdded:Connect(function(plr) local leaderstats = Instance.new("Folder") leaderstats.Name("leaderstats") leaderstats.Parent = plr
local val = Instance.new("IntValue") val.Name = "Points" val.Value = 0 val.Parent = leaderstats local val = Instance.new("IntValue") val.Name = "Wins" val.Value = 0 val.Parent = leaderstats
end)
its giving me the error in the title and i dont know how to fix it
game.Players.PlayerAdded:Connect(function(plr) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = plr local val = Instance.new("IntValue") val.Name = "Points" val.Value = 0 val.Parent = leaderstats local val = Instance.new("IntValue") val.Name = "Wins" val.Value = 0 val.Parent = leaderstats end)
Why were you doing this leaderstats.Name("leaderstats")
, .Name is a property that you need to set to a string value, string values are a group of characters and words inside of these " "
"this is a string" "pizza 25" "cool"
Doing leaderstats.Name("leaderstats")
doesn't make any sense, well it does, if .Name was a function, and "leaderstats" will act up like a paramater to it, but not in your caset, Name is a property, this the way of setting properties.
leaderstats.Name = "leaderstats"
Remember that =
(this is called an operator) is used to set properties, or variables to something, something.function()
and this format is always acting up like a function