Vscript SetPlayerClass() action isn't working

  • Site Migration: See bugs? Report them here. Want something changed or have an idea? Suggest it here.
  • If you're asking a question make sure to set the thread type to be a question!
  • Something not downloading? Download authors read this.

Top sporing fungi

L1: Registered
Mar 12, 2022
8
1
A pretty easy function, the result is a respawn and both messages but no class changes,
problem is that it should change.
this is put on a trigger for testing
The result in console is:

working
EntSelectSpawnPoint(): No valid spawns for class #TF_Class_Name_Demoman on team 2 found, even though at least one spawn entity exists.
finish
SCRIPT PERF WARNING --- "Classchanger" ran long at 3.314371ms

The Code:
function Classchanger()
{
printl("working")
activator.SetPlayerClass(2)
activator.ForceRegenerateAndRespawn()
printl("finish")
}