What Functions would I use, so that once a Player joins the Server and spawns, the screen is black and fades out to the normal screen?
Dude, you're asking for a lot of shit lately, you gotta learn yourself, but uh I guess here's something to get you started, it's a hacky way but it works.
[lua]
--init.lua
function GM:PlayerInitialSpawn(player)
umsg.Start("FadeToStart",player)
umsg.End()
end
--cl_init.lua
local intro = false
local alpha = 255
usermessage.Hook("FadeToStart",function()
intro = true
end)
timer.Create("EndFade",0.1,0,function()
if intro && alpha > 0 then
alpha = alpha - 1
end
if alpha < 1 then
timer.Destroy("EndFade")
end
end)
function FadeEffect()
draw.RoundedBoxEx(1,0,0,ScrW(),ScrH(),Color(0,0,0,alpha))
end
hook.Add("HUDPaint","FadeEffect",FadeEffect)
[/lua]
Untested but it should work, hopefully.
Werewolf rated me dumb? :wtc:
Im sorry, I thought I could just learn from others :3, Ill just start searching threw The Gmod Lua Wiki. I really appreciate all you guys are doing.
The wiki is very useful, I tend to use overv's search bin more often though, it comes back with results cleaner and quicker along with a link directly to the wiki page;
[url]http://luasearch.overvprojects.nl/[/url]
Thanks!
Sorry, you need to Log In to post a reply to this thread.