I did a Dpanel script with some serverside codes. Im not sure it doesn't pop up in game. If i mess up the codes while in game and save it, then the dpanel will pop up.
Heres the clientside codes :
-- Hope's Code -- Hello! This is my new gamemode of IQ Game 8/10/2018print ("This works.")
net.Start ("MessageIntro")
net.SendToServer()
local Frame = vgui.Create( "DFrame" )
Frame:SetTitle( "Choose your Class" )
Frame:SetSize( 300, 300 )
Frame:Center()
Frame:MakePopup()
Frame.Paint = function( self, w, h )-- 'function Frame:Paint( w, h )' works too
draw.RoundedBox( 0, 0, 0, w, h, Color( 231, 76, 60, 150 ) ) -- Draw a red box instead of the frameendlocal button_Master = vgui.Create( "DButton", Frame )
local ply = LocalPlayer()
button_Master:SetText( "Mastermind" )
button_Master:SetTextColor( Color( 255, 255, 255 ) )
button_Master:SetPos( 100, 100 )
button_Master:SetSize( 100, 30 )
button_Master.Paint = function( self, w, h )function button_Master:DoClick()
local ply = LocalPlayer ()
ply:ChatPrint("You are now a Mastermind ")
net.Start( "playerModel" ) -- starts the net message to send to the server
net.SendToServer()
Frame:Close()
end
draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue buttonendlocal button_Detective = vgui.Create( "DButton", Frame )
button_Detective:SetText( "Detective" )
button_Detective:SetTextColor( Color( 255, 255, 255 ) )
button_Detective:SetPos( 100, 50 )
button_Detective:SetSize( 100, 30 )
button_Detective.Paint = function( self, w, h )function button_Detective:DoClick()
local ply = LocalPlayer ()
ply:ChatPrint("You are now a Detective ")
net.Start( "playerModel_Detective" ) -- starts the net message to send to the server
net.SendToServer()
Frame:Close()
end
draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue buttonend
And this is the serverside codes :
util.AddNetworkString ("playerModel")
util.AddNetworkString ("playerModel_Detective")
util.AddNetworkString ("MessageIntro")
-- Introduction
net.Receive ("MessageIntro" , function (bits , ply )
timer.Create( "Intro", 1, 10, function() ply:PrintMessage( HUD_PRINTCENTER, "Hi, Welcome to your Promotion Grade Test. In here we will be testing your IQ to solve a case." ) end )
end)
-- Mastermind
net.Receive( "playerModel", function( bits, ply )
ply:SetModel( "models/player/lulsec.mdl" )
end)
--Detective Playermodel
net.Receive( "playerModel_Detective", function( bits, ply )
ply:StripWeapons()
ply:SetModel( "models/sirgibs/ragdolls/detective_magnusson_player.mdl" )
end)
Any lua errors?You can check them by re-saving luas.
Sorry, you need to Log In to post a reply to this thread.