Open Derma on chat command p2 (for darkrp/starwarsrp)
5 replies, posted
Open Derma on chat command
As mentioned in my reply to the previous topic about this:
"really sorry to be bumping an old thread but I'm in the starwarsrp/DarkRP gamemode on a local dedicated server(my machine).
I can use text commands just fine like whisper, yell, etc. However when I made this a command in the customcommands module for darkrp (the one that contains gui.OpenURL commands) it gave me a bunch of lua errors.
Now that I've worked through all of the lua errors the code runs just fine but nothing happens. The code is located in sv_chatcommands.lua so maybe that's why?
I used Luapad and it confirms that it's working clientside but I can't use it to verify serverside because "I'm not an admin".
So in short... I'm not getting any lua errors anywhere but nothing happens when i type "!mission" into chat:
local function OpenMSN(ply, text, team)
hook.Add("PlayerSay", "OpenMSN", function(ply, text, team)
if ply == LocalPlayer() && text == "!mission" then
local igcfg = vgui.Create("DFrame")
igcfg:SetPos(0,0)
igcfg:SetSize(500,400)
igcfg:SetTitle("")
igcfg:SetVisible(true)
igcfg:ShowCloseButton(true)
igcfg:MakePopup()
igcfg:Center()
print("Hook loads")
return true
end
end)
print("Mission Loaded")
end
"
boomp
PlayerSay is a server-side hook, LocalPlayer and vgui is not
I put it in cl_init.lua and it returns:
https://imgur.com/a/Z2NWv
...what fkn symbol is it trippin about?
he gave you working code then you proceed to add "local ply" in there? why
lmao I honestly have no clue how "local" got in there I just woke up... drinking coffee cut me some slack please
Sorry, you need to Log In to post a reply to this thread.