There are tons of weapons for Traitors but the Detectives are pretty left out. What would be some good (and preferably balanced) Detective weapons?
Heart Monitor: When the D dies and has this, itll announce his death to all players and id his body
The detective has a lot of useful items to get on the server I always play on.
Riot shield, parachute, a disguised shotgun (so you'll look unarmed), a weapon that disorients when you shoot someone - only to name a few.
[QUOTE=Mornedil;44738140]The detective has a lot of useful items to get on the server I always play on.
Riot shield, parachute, a disguised shotgun (so you'll look unarmed), a weapon that disorients when you shoot someone - only to name a few.[/QUOTE]
The [url=http://facepunch.com/showthread.php?t=1238474]Riot Shield[/url] is free and the gun that disorients people is called the UMP Prototype and comes with the game.
Avoid stuff that is similar to already existing items.
[QUOTE=NiandraLades;44739180]Avoid stuff that is similar to already existing items.[/QUOTE]
That's kinda hard as CoderHire has made all of the "THATS A NICE IDEA" things. Making something unique and not seen before that a detective and not a traitor can use if really hard to find a idea that would work.
^ my opinion
[QUOTE=Sm63;44735914]Heart Monitor: When the D dies and has this, itll announce his death to all players and id his body[/QUOTE]
I've been looking into this. I need to figure out how to code a equip item..
[QUOTE=Exho;44739659]I've been looking into this. I need to figure out how to code a equip item..[/QUOTE]
Ill show ya :P
[code]
EQUIP_THING = 8
local function Init()
local equipitem = {
id = EQUIP_THING,
loadout = false,
type = "item_passive",
material = "vgui/ttt/icon_thing",
name = "fucking acecool remover",
desc = "removes all acecools"
}
table.insert( EquipmentItems[ROLE_TRAITOR], equipitem )
table.insert( EquipmentItems[ROLE_DETECTIVE], equipitem )
end
hook.Add( "InitPostEntity", "LoadEquipItem", Init )
[/code]
ply:HasEquipmentItem(EQUIP_THING)
to detect if the player has it.
[QUOTE=Sm63;44743597]Ill show ya :P
ply:HasEquipmentItem(EQUIP_THING)
to detect if the player has it.[/QUOTE]
Ooh thank you very much!! Would I just do the coding for the item itself after that? And where would I put said lua file? Sorry for the questions lol, there isnt much information on these
autorun seems to work. Basically:
Do it in order from what I posted.
Insert the item into the table (First code)
then do use other lua syntax with ply:HasEquipmentItem() to detect if the player has it.
How about a device that has a one time use, which can be pointed at a close by player and verify if the player is a T or not. Like a mobile traitor tester. If that is too OP then maybe it can detect if the tested player has killed any other players that round (If that is codeable).
Or a bomb dog. A dog in a leash (would only be a model ofc) that makes a foggy colored trail (like in the murder gamemode) to nearby explosives, even if they are on a traitor.
If the server has custom explosive weapons, then i guess you could add all the weapons you consider explosives to a table.
[QUOTE=zapha;44768631]How about a device that has a one time use, which can be pointed at a close by player and verify if the player is a T or not. Like a mobile traitor tester. If that is too OP then maybe it can detect if the tested player has killed any other players that round (If that is codeable).
[/QUOTE]
Thats very doable. Do a PlayerDeath hook, if the victim was a player and the attacker was a player, then set a NWBool for the attacker to true, then check on the weapon
if User:GetNWBool("killedplayer", false) then
or something like that.
[QUOTE=Sm63;44770008]Thats very doable. Do a PlayerDeath hook, if the victim was a player and the attacker was a player, then set a NWBool for the attacker to true, then check on the weapon
if User:GetNWBool("killedplayer", false) then
or something like that.[/QUOTE]
Im still fairly shit at Lua, so can you tell me if im on the right track?
[LUA]
hook.Add("PlayerDeath", "Binder", function(vic, wep, att)
if GetRoundState() == ROUND_ACTIVE then
if att:IsPlayer() then
att:SetNWBool("killedPlayer", true)
else
return
end
end
end)
function SWEP:PrimaryAttack()
local tr = util.TraceLine({
start = self.Owner:EyePos(),
endpos = self.Owner:EyePos() + self.Owner:GetAimVector() * 80,
filter = self.Owner
})
if tr.Entity:IsPayer() then
if Player:GetNWBool("killedplayer", true) then
setSwepPanelColor(red) --- im thinking a device with a screen.
else setSwepPanelColor(green)
end
else return
end
[/LUA]
Check if the victim is a player too and make sure the attacker isnt itself. Also, hook into end round and set everyones nwbool to false. Also, dont do Player:GetNWBool("killedPlayer", true) as the second argument is the default
[editline]10th May 2014[/editline]
You also forgot an end for the SWEP function
[QUOTE=Sm63;44771448]Check if the victim is a player too and make sure the attacker isnt itself. Also, hook into end round and set everyones nwbool to false. Also, dont do Player:GetNWBool("killedPlayer", true) as the second argument is the default
[editline]10th May 2014[/editline]
You also forgot an end for the SWEP function[/QUOTE]
Thank you for helpfull advice!
How about now :) ?
[LUA]
hook.Add("PlayerDeath", "Binder", function(vic, wep, att)
if GetRoundState() == ROUND_ACTIVE then
if att:IsPlayer() and vic:IsPlayer() and not att:self.Player then --- i have a feeling the self.player is not set up right, so feel free to leave a comment!
att:SetNWBool("killedPlayer", true)
else
return
end
end
end)
function SWEP:PrimaryAttack()
local tr = util.TraceLine({
start = self.Owner:EyePos(),
endpos = self.Owner:EyePos() + self.Owner:GetAimVector() * 80,
filter = self.Owner
})
if tr.Entity:IsPayer() then
if Player:GetNWBool(killedplayer) then
setSwepPanelColor(red) --- im thinking a device with a screen.
else setSwepPanelColor(green)
end
else return
end
end
hook.Add("RoundEnd", "setNWBoolfalse", function()
for k,v in pairs( player.GetAll() ) do
v:SetNWBool("killedPlayer",false)
end
end)
[/LUA]
[QUOTE=zapha;44771567]Thank you for helpfull advice!
How about now :) ?
[LUA]
hook.Add("PlayerDeath", "Binder", function(vic, wep, att)
if GetRoundState() == ROUND_ACTIVE then
if att:IsPlayer() and vic:IsPlayer() and not att:self.Player then --- i have a feeling the self.player is not set up right, so feel free to leave a comment!
att:SetNWBool("killedPlayer", true)
else
return
end
end
end)
function SWEP:PrimaryAttack()
local tr = util.TraceLine({
start = self.Owner:EyePos(),
endpos = self.Owner:EyePos() + self.Owner:GetAimVector() * 80,
filter = self.Owner
})
if tr.Entity:IsPayer() then
if Player:GetNWBool(killedplayer) then
setSwepPanelColor(red) --- im thinking a device with a screen.
else setSwepPanelColor(green)
end
else return
end
end
hook.Add("RoundEnd", "setNWBoolfalse", function()
for k,v in pairs( player.GetAll() ) do
v:SetNWBool("killedPlayer",false)
end
end)
[/LUA][/QUOTE]
[LUA]
hook.Add("PlayerDeath", "ByeByeNWBoolShit", function(vic, wep, att)
if GetRoundState() == ROUND_ACTIVE then
if att:IsPlayer() and vic:IsPlayer() and att ~= vic then --- i have a feeling the self.player is not set up right, so feel free to leave a comment!
att:SetNWBool("killedPlayer", true)
end
end
end)
function SWEP:PrimaryAttack()
local tr = util.TraceLine({
start = self.Owner:EyePos(),
endpos = self.Owner:EyePos() + self.Owner:GetAimVector() * 80,
filter = self.Owner
})
if tr.Entity:IsValid() and tr.Entity:IsPlayer() then
if tr.Entity:GetNWBool("killedPlayer", false) then
setSwepPanelColor(red) --- im thinking a device with a screen.
else setSwepPanelColor(green)
end
end
end
hook.Add("TTTEndRound", "setNWBoolfalse", function()
for k,v in pairs( player.GetAll() ) do
v:SetNWBool("killedPlayer",false)
end
end)
[/LUA]
[QUOTE=Sm63;44771718][LUA]
hook.Add("PlayerDeath", "ByeByeNWBoolShit", function(vic, wep, att)
if GetRoundState() == ROUND_ACTIVE then
if att:IsPlayer() and vic:IsPlayer() and att ~= vic then --- i have a feeling the self.player is not set up right, so feel free to leave a comment!
att:SetNWBool("killedPlayer", true)
end
end
end)
function SWEP:PrimaryAttack()
local tr = util.TraceLine({
start = self.Owner:EyePos(),
endpos = self.Owner:EyePos() + self.Owner:GetAimVector() * 80,
filter = self.Owner
})
if tr.Entity:IsValid() and tr.Entity:IsPlayer() then
if tr.Entity:GetNWBool("killedPlayer", false) then
setSwepPanelColor(red) --- im thinking a device with a screen.
else setSwepPanelColor(green)
end
end
end
hook.Add("TTTEndRound", "setNWBoolfalse", function()
for k,v in pairs( player.GetAll() ) do
v:SetNWBool("killedPlayer",false)
end
end)
[/LUA][/QUOTE]
Much better name for the hook ;)
And thanks for fixing my erros.
What I dont get is why you would want to set the NWBool to false after each round, and then check if it is false. Should it not check if it is true since everyone is already false?
EDIT:
I guess it would make more sense if i say that red = yes, player has blood on his hands, green = innocence intact
[QUOTE=zapha;44768631]How about a device that has a one time use, which can be pointed at a close by player and verify if the player is a T or not. Like a mobile traitor tester. If that is too OP then maybe it can detect if the tested player has killed any other players that round (If that is codeable).
Or a bomb dog. A dog in a leash (would only be a model ofc) that makes a foggy colored trail (like in the murder gamemode) to nearby explosives, even if they are on a traitor.
If the server has custom explosive weapons, then i guess you could add all the weapons you consider explosives to a table.[/QUOTE]
You could call it truth serum. And when you inject it into somebody that has killed they shout "I KILLED X Y AND Z AND I MADE THEM FUCKING SUFFER", and if they haven't killed anybody it should make them state an embarrassing revelation about themselves.
[QUOTE=thelurker1234;44771888]You could call it truth serum. And when you inject it into somebody that has killed they shout "I KILLED X Y AND Z AND I MADE THEM FUCKING SUFFER", and if they haven't killed anybody it should make them state an embarrassing revelation about themselves.[/QUOTE]
Love the idea. I guess you would have to make a table of victims for each player killing someone else, and then printing that table if injected. Not sure if Im capable of coding that, but Ill see later.
[QUOTE=zapha;44772034]Love the idea. I guess you would have to make a table of victims for each player killing someone else, and then printing that table if injected. Not sure if Im capable of coding that, but Ill see later.[/QUOTE]
[lua]
local kills = att:GetNWString( "Kills", nil )
if kills then
kills = util.JSONToTable( kills )
table.insert( kills, vic:Nick() )
att:SetNWString( "Kills", util.TableToJSON( kills ) )
else
kills = { vic:Nick() }
att:SetNWString( "Kills", util.TableToJSON( kills ) )
end
// and just to avoid the extra hook
vic:SetNWString( "Kills", nil )
[/lua]
Not sure if setting the NWString as nil works though.
[QUOTE=HumbleTH;44772090][lua]
local kills = att:GetNWString( "Kills", nil )
if kills then
kills = util.JSONToTable( kills )
table.insert( kills, vic:Nick() )
att:SetNWString( "Kills", util.TableToJSON( kills ) )
else
kills = { vic:Nick() }
att:SetNWString( "Kills", util.TableToJSON( kills ) )
end
// and just to avoid the extra hook
vic:SetNWString( "Kills", nil )
[/lua]
Not sure if setting the NWString as nil works though.[/QUOTE]
Not really sure if I understood all that, but im sure it will come in handy when Ill try to make this. thank you.
[QUOTE=zapha;44771759] then check if it is false. [/QUOTE]
Im not checking if its false. The second argument is the default value of that NWBool. So by default, everyones "killedPlayer" NWBool is false by default.
[QUOTE=Sm63;44772295]Im not checking if its false. The second argument is the default value of that NWBool. So by default, everyones "killedPlayer" NWBool is false by default.[/QUOTE]
What does this do then?
[LUA]
GetNWBool("killedPlayer", false)
[/LUA]
[QUOTE=zapha;44772761]What does this do then?
[LUA]
GetNWBool("killedPlayer", false)
[/LUA][/QUOTE]
if the players NWBool "killedPlayer" is true, then
If you wanna do if its not true, then
if not Player:GetNWBool("killedPlayer", false) then
I'm gonna make these...
These are good ideas. When I get around to it, and if others don't beat me, I'll post it here.
[QUOTE=AnonTakesOver;44773195]I'm gonna make these...
These are good ideas. When I get around to it, and if others don't beat me, I'll post it here.[/QUOTE]
I did the Heart Monitor ages ago. The only issue you'll have is when youre checking on the players death is the victim has the equipment. As the function runs after that, the StripAll function removes all the equipment off the player before you can even check if they have it
btw, is it possible in lua to make path to an entity? Or would it only be linear in that case?
Like if you equiped an item that shows a path of smoke to an entity.
I know you can make a Trail behind an entity, but can you make it like reversed?
[QUOTE=zapha;44773741]btw, is it possible in lua to make path to an entity? Or would it only be linear in that case?
Like if you equiped an item that shows a path of smoke to an entity.
I know you can make a Trail behind an entity, but can you make it like reversed?[/QUOTE]
Elaborate?
[QUOTE=Sm63;44774049]Elaborate?[/QUOTE]
If someone plants a bomb. And you have a device that can track the bomb entity. Is it possible to make a path to that entity in form of a trail?
This is the spell Clairvoyance from Skyrim. Kind of what i mean.
[IMG]http://img2.wikia.nocookie.net/__cb20111112053601/elderscrolls/images/4/40/ClairvoyanceSpell.jpg[/IMG]
[QUOTE=AnonTakesOver;44773195]I'm gonna make these...
These are good ideas. When I get around to it, and if others don't beat me, I'll post it here.[/QUOTE]
I'm working on the heart monitor with a buddy of mine (who is better at lua).
Sorry, you need to Log In to post a reply to this thread.