Hi, I was wondering how to add slow-motion to the final kill on a TTT round. I have set up win sounds that play when the final kill is placed, I can add slow motion to play from there. My end sound code:
local function PlayMusic(wintype)
if wintype == WIN_INNOCENT then
BroadcastLua('surface.PlaySound("song" .. math.random(1,12) .. ".mp3")')
RunConsoleCommand("sv_cheats 1")
RunConsoleCommand("host_timescale .3")
elseif wintype == WIN_TRAITOR then
BroadcastLua('surface.PlaySound("song" .. math.random(1,12) .. ".mp3")')
RunConsoleCommand("sv_cheats 1")
RunConsoleCommand("host_timescale .3")
elseif wintype == WIN_TIMELIMIT then
BroadcastLua('surface.PlaySound("song" .. math.random(1,12) .. ".mp3")')
RunConsoleCommand("sv_cheats 1")
RunConsoleCommand("host_timescale .3")
end
end
hook.Add("TTTEndRound", "MyMusic", PlayMusic)
local function Start()
if TTTPrepareRound == TTTPrepareRound then
RunConsoleCommand("host_timescale 3")
RunConsoleCommand("sv_cheats 0")
end
end
I tried to use host_timescale, but it didn't work. Any ideas? :suicide:
[editline]14th October 2012[/editline]
Bump.
I tried that. Do I install an addon for slow mo? If I do, can you link me to one?
[QUOTE=sackcreator54;38026216]I tried that. Do I install an addon for slow mo? If I do, can you link me to one?[/QUOTE]
[lua]
//Example
game.ConsoleCommand("host_timescale 0.3")
[/lua]
Haven't you read the wiki? You need to have it in this format:
game.ConsoleCommand( "host_timescale 0.3\n" )
Oh, and it just occurred to me that you need sv_cheats set to 1 for this to work.
I hope many servers will use this, so we can cheat while the slow-mo is on. :'D
Get Gm_Cvar2 And Force Sv_Cheats You Stupid Skid
host_timescale isn't synced in garrysmod 12.
Wait for the update, then just use game.SetTimeScale.
[QUOTE=Leystryku;38049096]host_timescale isn't synced in garrysmod 12.
Wait for the update, then just use game.SetTimeScale.[/QUOTE]
Pretty Much What I Posted Dont Steal My Thunder Skid
[QUOTE=(-SG-)Wearing;38050846]Pretty Much What I Posted Dont Steal My Thunder Skid[/QUOTE]
Go kill yourself, You make a bad name for SteamGamers.
Sorry, you need to Log In to post a reply to this thread.