ItsMods

Full Version: Script help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to get slowmo to go back to timescale 1 when round ends, but I cant get anything to work. Heres the code:


timeScale()
{
if(level.timeScale)
{
setdvar("timescale", "0.5");
}
else
{
setdvar("timescale", "1");
}
level.timeScale = !level.timeScale;
self.menu["ui"]["menuDisp"][3] setText(level.timescale ? "^2Toggle slow timescale." : "^1Toggle normal timescale");
}


any help is appreciated. Thanks!
(09-14-2014, 03:36)swegspoder69 Wrote: [ -> ]I'm trying to get slowmo to go back to timescale 1 when round ends, but I cant get anything to work. Heres the code:


timeScale()
{
if(level.timeScale)
{
setdvar("timescale", "0.5");
}
else
{
setdvar("timescale", "1");
}
level.timeScale = !level.timeScale;
self.menu["ui"]["menuDisp"][3] setText(level.timescale ? "^2Toggle slow timescale." : "^1Toggle normal timescale");
}


any help is appreciated. Thanks!

Spoder, ur cute. 11/10.
1) timescale is latched or readonly ( try to turn sv_cheats on ).
2) Set initial value for level.timescale.