• Entity only works on Single Player
    1 replies, posted
It works fine on single player but not on my server. (It doenst show up in Q menu). cl_init include("shared.lua") function ENT:Draw()   self:DrawModel() local offset = Vector( 0, 0, 70 ) local ang = LocalPlayer():EyeAngles() local pos = self:GetPos() + offset + ang:Up() ang:RotateAroundAxis( ang:Forward(), 90 ) ang:RotateAroundAxis( ang:Right(), 90 )    cam.Start3D2D( pos, Angle( 0, ang.y, 90 ), 0.50 )    draw.DrawText( "Arrest Transmitter", "TargetID", 2, 2, Color(255,255,255), TEXT_ALIGN_CENTER )    cam.End3D2D() end net.Receive( "entused", function() local Frame = vgui.Create( "DFrame" ) Frame:SetTitle( "Arrest Menu" ) Frame:SetSize( 180, 250 ) 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 frame end local DLabel = vgui.Create( "DLabel", Frame) DLabel:SetPos( 40, 60 ) DLabel:SetText( "Name:" ) local nameentry = vgui.Create( "DTextEntry", Frame) nameentry:SetPos( 70, 60) nameentry:SetSize( 80, 20 ) local reasonlabel = vgui.Create( "DLabel", Frame) reasonlabel:SetPos( 30, 100 ) reasonlabel:SetText( "Reason:" ) local reasonentry = vgui.Create( "DTextEntry", Frame) reasonentry:SetPos( 70, 100) reasonentry:SetSize( 80, 20 ) local timelabel = vgui.Create( "DLabel", Frame) timelabel:SetPos( 27, 140 ) timelabel:SetText( "Minutes:" ) local timeentry = vgui.Create( "DTextEntry", Frame) timeentry:SetPos( 70, 140) timeentry:SetSize( 80, 20 ) local arrestbutton = vgui.Create( "DButton", Frame) arrestbutton:SetText( "Arrest" ) arrestbutton:SetPos( 70, 185 ) arrestbutton:SetSize( 80, 30 ) arrestbutton.DoClick = function() name = nameentry:GetValue() reason = reasonentry:GetValue() timenotchanged = timeentry:GetValue() timeminutes = util.StringToType( timenotchanged, "int" ) timeseconds = timeminutes*60 LocalPlayer():ConCommand( "say" .. " /advert" .. " Name: " .. name .. " Reason: " .. reason .. " Minutes: " .. timeminutes ) timer.Create( "UniqueName2", timeseconds, 1, function()   LocalPlayer():ConCommand( "say" .. " I Should release " .. name ) end ) end end ) init AddCSLuaFile("shared.lua") AddCSLuaFile( "cl_init.lua" ) include("shared.lua") function ENT:Initialize()    self:SetModel( "models/lt_c/sci_fi/rails_48.mdl" )    self:PhysicsInit( SOLID_VPHYSICS )    self:SetMoveType( MOVETYPE_VPHYSICS )    self:SetSolid( SOLID_VPHYSICS )    local phys = self:GetPhysicsObject()    if (phys:IsValid()) then     phys:Wake()   end   util.AddNetworkString( "entused" ) end function ENT:Use( activator, caller ) if IsValid( caller ) and caller:IsPlayer() then timer.Create( "UniqueName2", 0.1, 1, function() net.Start( "entused" ) net.Send( caller ) end ) end end shared ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "Arrest Transmitter" ENT.Spawnable = true ENT.Category = "Star Wars Transmitters"
Fixed it
Sorry, you need to Log In to post a reply to this thread.