✓ Accepted answer
The script is fine, the reason that your IntValue isn't changing is because you aren't changing the value on the server. If you change a value on a client, it doesn't replicate to the server. This is to prevent exploiters, let's say a hacker sets their cash to 10000000, the server would still see it as 0. To fix this you could either increment the value
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
local Folder = Instance.new("Folder")
Folder.Name = "leaderstats"
Folder.Parent = player
local Level = Instance.new("IntValue")
Level.Name = "Level"
Level.Parent = Folder
local qoroutine = coroutine.create(function()
while true do
Level.Value += 1
print(Level.Value)
wait(.1)
end
end)
coroutine.resume(qoroutine)
end)
or you could just do this and change the value on the server
1 comment
thank you very much, i was really confused