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 <eof>' 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
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 local function timePassed() level.Value = level.Value + 1 end while wait(30) do timePassed() end end game.Players.PlayerAdded:Connect(onPlayerJoin)