TTT kill vgui

I tried to make something that if a teammate in TTT kills you a vgui box will popup asking whether or not it is RDM, but so far it does not work. Does anyone have any idea whats wrong?

Client version:
[LUA]local teamlist = {“innocent.”, “traitor.”, “detective.”}
function RdmCheck(um)
local nick = um:ReadString()
local team = um:ReadChar()
end

function RdmCheckup(um)
local Form = vgui.Create(“DFrame”)
Form:SetPos(5,5)
Form:SetSize(300,100)
Form:SetTitle(“RDM Check”)
Form:SetVisible(true)
Form:SetDraggable(false)
Form:ShowCloseButton(true)
Form:MakePopup()

Label = vgui.Create(“DLabel”, Form)
Label:SetText(“You were killed by a Teamate! Was this rdm or a fair kill?”)
Label:SizeToContents()

Button1 = vgui.Create(“DButton”)
DermaButton:SetParent(Form)
DermaButton:SetText(“Fair kill”)
DermaButton:SetPos (50,25)
DermaButton:SetSize(100, 25)
DermaButton.DoClick= function()
Form:Close()
end

Button2 = vgui.Create(“DButton”)
DermaButton:SetParent(Form)
DermaButton:SetText(“RDM”)
DermaButton:SetPos (50,75)
DermaButton:SetSize(100, 25)
DermaButton.DoClick= function()
RunConsoleCommand(“ulx”,“asay”,“Reporting”,attacker,“for RDM”)
end

end

usermessage.Hook(“KillMsg”, KillMessage) [/LUA]

Server:
[LUA]AddCSLuaFile(“autorun/client/cl_rdmcheck.lua”)

function RdmCheck(victim, wep, attacker)
if GetRoundState() == ROUND_ACTIVE then
if not IsValid(attacker) or not IsValid(victim) then return end
if attacker == victim then return end
if not attacker:IsPlayer() or not victim:IsPlayer() then return end

if attacker:GetTraitor() = victim:GetTraitor() then
umsg.Start(“KillMsg”, victim)
umsg.String(attacker:Nick())

		umsg.End()

else
if attacker:IsDetective() and victim:IsInnocent() then

umsg.Start(“KillMsg”, victim)
umsg.String(attacker:Nick())

		umsg.End()

else
if attacker:IsDetective() and victim:IsDetective() then

umsg.Start(“KillMsg”, victim)
umsg.String(attacker:Nick())

		umsg.End()

else
if attacker:IsInnocent() and victim:IsDetective() then

umsg.Start(“KillMsg”, victim)
umsg.End()
end
end
end
end
end
end

[/LUA]

Any errors?

(Jeez, inline tab your code)

No error whatsoever. I think it has something to do with getting whether or not someone is killed, but I cant find whats wrong.
Sorry about the lines :suicide:

I’ll take a look for you later tonight, got a few jobs to do first.

You have there Button1 which is the DButton but then you are using DermaButton , why ?
[lua]

Wrong

Button1 = vgui.Create(“DButton”)
DermaButton:SetParent(Form)
DermaButton:SetText(“Fair kill”)
DermaButton:SetPos (50,25)
DermaButton:SetSize(100, 25)

Correct

Button1 = vgui.Create(“DButton”)
Button1:SetParent(Form)
Button1:SetText(“Fair kill”)
Button1:SetPos (50,25)
Button1:SetSize(100, 25)

[/lua]
same with Button2

I actually just restarted completely and now it works but thank you anyway.

Everything else is working except the file.Write thing, could anyone tell me whats wrong?
[LUA]print(“Kill message script loaded!”)
local teamslist = {" innocent.", " traitor.", " detective."}
local teamscolors = {Color(0, 200, 0, 255), Color(180, 50, 40, 255), Color(50, 60, 180, 255)}

function PrintKillMsg(um)
local nick = um:ReadString()
local team = um:ReadChar()
local Form = vgui.Create(“DFrame”)
Form:SetPos(800, 580)
Form:SetSize(350,100)
Form:SetTitle(“RDM Check”)
Form:SetVisible(true)
Form:SetDraggable(false)
Form:ShowCloseButton(true)
Form:MakePopup()

Label = vgui.Create(“DLabel”, Form)
Label:SetText(“You were killed by a teammate! Was this RDM or a fair kill?”)
Label:SetPos(25, 25)
Label:SizeToContents()

Button1 = vgui.Create(“DButton”)
Button1:SetParent(Form)
Button1:SetText(“Fair kill”)
Button1:SetPos (20,50)
Button1:SetSize(100, 25)
Button1.DoClick = function()
Form:Close()
end

Button2 = vgui.Create(“DButton”)
Button2:SetParent(Form)
Button2:SetText(“RDM”)
Button2:SetPos (225,50)
Button2:SetSize(100, 25)
Button2.DoClick = function()
ply = LocalPlayer
RunConsoleCommand(“ulx”,“asay”,“Reporting”,nick, “for”,“RDM”)
file.Write(“data/RDM_claims.txt”,ply, “claimed” ,nick, "committed RDM
")
Form:Close()
end
end
usermessage.Hook(“KillMsg”, PrintKillMsg)[/LUA]

Try concatenating it instead.
[lua]
file.Write(“data/RDM_claims.txt”, ply:Nick()…" claimed “…nick…” committed RDM
")
[/lua]
Why are you saving this file clientside anyway? Wouldn’t it be more useful on the server?

I forgot I was client side and that was part of why I didn’t see the file.:v: Thank you