• Run a function from cl_init from a function in init.lua
    2 replies, posted
Hey there, trying to make a teams screen black for a few seconds, i have this code cl_init.lua [lua] local function BlackScreen() surface.SetDrawColor(Color(0,0,0)) draw.NoTexture() surface.DrawRect(0,0,ScrW(),ScrH()) LocalPlayer():SetAngles(Angle(-90,0,0)) -- I think -90 is down, could be wrong hook.Add( "HUDPaint", "BlackScreen", BlackScreen ) end concommand.Add( "BlackScreen", BlackScreen ) local function NormalScreen() hook.Remove( "HUDPaint", "BlackScreen" ) end concommand.Add( "NormalScreen", NormalScreen ) [/lua] init.lua [lua] function NightTime( ply ) BlackScreen() ply:SetAngles(Angle(90,0,0)) ply:Freeze() end concommand.Add( "NightTime", NightTime ) [/lua]
ply:SendLua("BlackScreen()"), and do BlackScreen() as global function
Thank you
Sorry, you need to Log In to post a reply to this thread.