My Script does not appear in the Traitor´s Shop. The Console does not print any Errors. Here is the Code:
[lua]if SERVER then
AddCSLuaFile(“shared.lua”)
resource.AddFile(“materials/VGUI/ttt/icon_the_assassin.vmt”)
end
EQUIP_THE_ASSASSIN = (GenerateNewEquipmentID and GenerateNewEquipmentID() ) or 16
local theassassin = {
id = EQUIP_THE_ASSASSIN,
loadout = false,
type = “item_passive”,
material = “vgui/ttt/icon_the_assassin.vmt”,
name = “The Assassin”,
desc = “Nothing is true, Everything is permitted.
You´ve 130 Seconds to kill your Target.
Otherwise you´ll be revealed as a Traitor.”,
hud = true
}
SWEP.CanBuy = { ROLE_TRAITOR }
SWEP.LimitedStock = true
///Server-Side///
if SERVER then
AddCSLuaFile(“shared.lua”)
resource.AddFile(“materials/VGUI/ttt/icon_the_assassin.vmt”)
util.AddNetworkString(“CreedMessage”)
util.AddNetworkString(“CreedMusic”)
local function CreedBroadcast(tbl)
net.Start("CreedMessage")
net.WriteTable(tbl)
net.Broadcast()
end
hook.Add( "TTTOderedEquipment", "ActivatingFight", function(ply)
if ply:Alive() and ply:IsValid() then
ply:SetHealth( 400 )
CreedBroadcast({"The Assassin: ", color_white, "An Assassin is among Us. Searching for Templars!"})
net.Start("CreedMusic")
net.Send(ply)
function randomPly()
local plys = {}
for z,g in pairs(player.GetAll()) do
if g:GetRole() == ROLE_INNOCENT and g:GetRole() == ROLE_DETECTIVE and !g:IsSpec() and g:Alive() then
table.insert(plys,g)
end
end
if #plys>0 then return plys[math.random(#plys)] end
end
timer.Simple( 10,
function()
PrintMessage( HUD_PRINTTALK, "The Assassin´s Target is " .. plys:Nick())
end)
local ChosenPly = randomPly()
timer.Simple( 130, function()
if !ply:Alive() then return end
if ChosenPly:Alive() and ChosenPly:IsValid() then
CreedBroadcast({"The Assassin: ", color_white, ply:Nick() .. " ,The Traitor betrayed his Creed. Find Him and Execute Him!"})
ply:SetHealth( 100 )
end
end)
end
end)
else
net.Receive(“CreedMessage”, function(len)
local Tbl = net.ReadTable()
chat.AddText(unpack(Tbl))
end)
net.Receive("CreedMusic", function(len)
local ply = LocalPlayer()
ply.Music = CreateSound(ply, "eaglescream.wav")
ply.Music:Play()
end)
hook.Add("TTTBodySearchEquipment", "CreedoCorpseIcon", function(search, eq)
search.theassassin = util.BitSet(eq, EQUIP_THE_ASSASSIN)
end )
hook.Add("TTTBodySearchPopulate", "CreedoCorpseIcon", function(search, raw)
if (!raw.eq_theassassin) then
return end
local highest = 0
for _, v in pairs(search) do
highest = math.max(highest, v.p)
end
search.eq_theassassin = {img = "vgui/ttt/icon_the_assassin", text = "He was a Member of the Assassin´s Creed.", p = highest + 1}
end )
end
[/lua]
Does anybody got an Idea ?