I have recently made an attempt to make a script that will increase the leaderstats level for “Value” by one every minute. However, I’m still quite inexperienced in Lua. That’s why I came here; I’m trying to get the leaderstats to increase by one every minute.
The script so far:
game.Players.PlayerAdded:Connect(function(players)
local leaderstats = Instance.new("Folder",players)
leaderstats.Name = 'leaderstats'
local Level = Insance.new(IntValue", leaderstats)
Level.Name = "Level"
end)
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Parent = player
leaderstats.Name = "LeaderStats"
local Level = Instance.new("IntValue")
Level.Parent = leaderstats
Level.Name = "Level"
while wait(60) do
Level.Value += 1
end
end)
Thank you for the response. Now that I have applied the changes that you recommended the leaderstats is no longer appearing.
I made a few changes and found that this works:
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "LeaderStats"
local Level = Instance.new("IntValue")
Level.Name = "Level"
while wait(60) do
Level.Value += 1
end
end)
The edit you made is not putting leaderstats under the player. But, if it works for you then I guess it is okay…
The script I provided did work, it probably didn’t appear on the actual leaderboard because of the capitalization for the name of Leaderstats. Roblox is cap-sensitive.
Like I said, roblox is cap sensitive so the name has to be leaderstats instead of Leaderstats. (lowercase “L”)
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Parent = player
leaderstats.Name = "leaderstats"
local Level = Instance.new("IntValue")
Level.Parent = leaderstats
Level.Name = "Level"
while wait(60) do
Level.Value += 1
end
end)