Jasper, when the resource starts.. Do you simply want to run that function with a 2-sec timer?
It won't work because player is not defined. You must define it somehow. But we don't know what you're trying to achieve.
Should the function run for all players when the resource starts (timer starts) ? It can't run for just 1 player unless this is specifically defined with getPlayerFromName() which is bad scripting
You can make it run for all players @ start if u use a FOR loop, looping though getElementsByType('player').
If you want to make this and don't know how, reply again and I'll (or someone else) help.