I’m back from yesterday hoping you kind people can once again help me with my script. I am very novice at lua so I appreciate any help or a step in the right direction. But I am here to learn!
I’m currently modifying DarkRP so it has a stats derma window which shows playtime and such. I’m attempting to make it so that you have a chat command which opens the menu for you, or if you specify a player. The code works but not when I attempt it with derma panels.
I’m unsure on how to make my derma panels show other players information when specified.
From my sv module:
local function Stats(ply, args)
local name = string.sub(args, 1)
target = DarkRP.findPlayer(name)
if name == "" then ply:ConCommand("statsopen") return "" end if target then ply:ConCommand("statsopen") else DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("could_not_find", tostring(name))) end return ""
and a snippet from my client file
local NameLabel = vgui.Create(“DLabel”, StatsMenu)
NameLabel:SetPos(300,30) // Position
NameLabel:SetColor(Color(255,255,255,255)) // Color
NameLabel:SetText(LocalPlayer():Nick(),“TargetID”) // Text
NameLabel:SizeToContents() // make the control the same size as the text.
Obviously I need to change the LocalPlayer():Nick() to something else, but I’m unsure what I need to define, nor change it to.
Once again, and help or a step in the right direction is appreciated. Thank you for reading.