Hi, I'm using filtering enabled to make a leaderstat that goes up by 1 every 30 seconds and it doesn't seem to work, all it does is break the leaderstat and it doesn't work. Also, I am trying this in-game when it doesn't work. It is in serverscriptservice and is a normal script. Error: '10:43:15.738 - ServerScriptServer.Level:17: ')' expected near ' I've tried so many times to fix this script and it's still not working.
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local level = Instance.new("IntValue")
level.Name = "Level"
level.Value = 0
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
local function timePassed()
level.Value = level.Value + 1
end
wait(30):Connect(timePassed()
Any tips or any other helpful things? Thanks -Aidan

6 comments
The problem was that you did wait(30):Connect(timePassed() when it should be wait(30):Connect(timePassed). However,I am not sure if that even exists so I did a loop instead
Another problem was that level was not defined since it was not inside the "onPlayerJoin" function.
Thanks! I'll try this.
Also, yeah when I did wait(30):Connect(timePassed) it did underline it so I will try my fixed script then yours.
Why didn't you accept my answer
Oops, forgot to!