• Overriding
    2 replies, posted
Hello there, I'm trying to override GM:ShowSpare1, however problem is that it doesn't work properly and nothing is displayed, here is the code for the function and cl_init.lua , please show it. function GM:ShowSpare1(ply) RunConsoleCommand("Speech") end I had to remove the lua tags for ShowSpare because it didn't display properly. [lua] include( 'shared.lua' ) function speechShow() local talkWindow=vgui.Create("DFrame") talkWindow:SetPos(0,0) talkWindow:SetSize(800,600) talkWindow:SetTitle("Yes?") talkWindow:SetDraggable(true) talkWindow:SetVisible(true) talkWindow:ShowCloseButton(true) talkWindow:MakePopup() local giveGun=vgui.Create("DButton") giveGun:SetPos(100,60) giveGun:SetSize(80,40) giveGun:SetParent( talkWindow ) giveGun:SetText("Take my gun.") giveGun.DoClick=function() RunConsoleCommand("armFriend") end end concommand.Add("Speech",speechShow) [/lua]
Alright, thanks.
Sorry, you need to Log In to post a reply to this thread.