Hey, does anybody know how i would make it so when i press USE on a printer it opens a Derma Panel?
I tried this.
[code]
function ENT:Use( ply )
if self:GetMoney() > 0 then
ply:addMoney( self:GetMoney() )
DarkRP.notify( ply, 0, 5, "You picked up " .. self:GetMoney() .. "!")
self:SetMoney( 0 )
local Frame = vgui.Create( "DFrame" )
Frame:SetPos( 5, 5 )
Frame:SetSize( 300, 150 )
Frame:SetTitle( "Name window" )
Frame:SetVisible( true )
Frame:SetDraggable( false )
Frame:ShowCloseButton( true )
Frame:MakePopup()
end
[/code]
Thanks!
Here's an example: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_zipped_code/acecool_npc_jointeam_example.rar[/url]
ENT:Use is server-side so you'll need to network a flag / message to the client, open it that way and if you want to click something that triggers something on the server, you'll need to network that data to the server.
Never trust client input either, don't trust the client to tell the server how much money they picked up...
Sorry, you need to Log In to post a reply to this thread.