Schedule a function as a player

I am making a datapack, and I need a function to give you slowness for 5 seconds, then run something when the slowness is up. But when i do schedule function, it runs as the server, not the player...

Continue to help post