• TTT Make everyone spawn with a specific weapon every round?
    2 replies, posted
I don't know much but I just want to make everyone who joins my server spawn with a revolver (weapon_revolver). The gun is already set to work on ttt but of cource to does not automaticlly go into my inventory... This link [url]http://facepunch.com/showthread.php?t=1233850[/url] shows that it postible to give weapons to the (regular) group... but I need one that gives it to everyone and as far as I know, there is not a group that everyone is automaticlly in.. Another solution would be to make anyone who joins the server automaticlly join a group like "normal". Thanks for the help I may recive!
[CODE]lua/autorun/giverevolver.lua[/CODE] [CODE] hook.Add("TTTPrepareRound","Give Revolver",function() for k, v in pairs(player.GetAll()) do v:Give("weapon_revolver") end) [/CODE] May need to use PlayerSpawn hook in case TTTPrepareRound is called before player spawns
PlayerLoadout would be the usual hook ( called inside PlayerSpawn after player spawns. Typically PlayerLoadout or the Spawn player code strips weapons, so if you add the weapon too soon, it may end up being removed ). Here's an example about how to give weapons based on group: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_gamemode_logic/give_weapons_based_on_group.lua.html[/url] It gives weapons on TTTBeginRound ( which is when everyone is alive, and after the PlayerSpawn/PlayerLoadout, stripweapons, etc )... Two other options to show how it is done.. Gun-Race game-mode logic: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_gamemode_logic/gun_race/sv_upgrade_weapons_for_kills.lua.html[/url] and [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_gamemode_logic/gun_race/sv_gun_race.lua.html[/url] [b]Hopefully these tutorials and information helps. As always, to view the Lua from any of my tutorials to enable copy/pasting ( HTML doesn't copy/paste well in terms of HTML / CSS Highlighted Lua ), remove .html from the url.[/b]
Sorry, you need to Log In to post a reply to this thread.