TTT Making Specific Player Spawn With A Special Weapon
0 replies, posted
Well hey guys, i'm kind of experienced with lua but the problem is that I want a specific player to spawn with a custom swep that I added to the server. I've been using some peoples codes but its been giving me this --->
[IMG]http://postimg.org/image/zbwgpovb1/5cb48365/[/IMG] (No Hands, and shoot people in spectator mode)
This is the code that i got off of Thetomm2010. It works but only when its for a group, not a single player. Thanks :D[CODE]if SERVER then
AddCSLuaFile("weaponspawn.lua")
end
function giveWeapon( ply )
if ply:Team() == 1 then
if ply:IsUserGroup("Head Admin") then
ply:Give("stungun")
elseif ply:IsUserGroup("Co Owner") then
ply:Give("stungun")
elseif ply:IsUserGroup("Bronze Donator") then
ply:Give("stungun")
elseif ply:IsUserGroup("Moderator") then
ply:Give("stungun")
elseif ply:IsUserGroup("Trial Mod") then
ply:Give("stungun")
elseif ply:IsUserGroup("superadmin") then
ply:Give("stungun")
elseif ply:IsUserGroup("Owner") then
ply:Give("stungun")
elseif ply:IsUserGroup("Senior Admin") then
ply:Give("stungun")
elseif ply:IsUserGroup("admin") then
ply:Give("stungun")
end
end
end
hook.Add("PlayerSpawn", "giverankedWeapon", giveWeapon)[/CODE]
Also, if you guys could help with something else that'd be cool! But I need the specific player to spawn code more. And make it where they can only do it once because they will mass spam it xD. Well, I have this code [CODE]local myurl = "http://steamcommunity.com/groups/Anon404"
function donateCommand( pl, text, teamonly )
if (text == "!join") then
pl:SendLua([[gui.OpenURL("http://steamcommunity.com/groups/Anon404")]])
for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has joined the steam group via !join" )
end
end
end
hook.Add( "PlayerSay", "Chat", donateCommand )[/CODE]
and it'd be awesome if when players did the !join command and joined the group it'd automatically give them 4 thousand points.
I know this is a lot to ask but when I learn to code i'd help people on the facepunch forums but first I need help :D , Thanks.
Sorry, you need to Log In to post a reply to this thread.