• F4 Shop
    12 replies, posted
Hi, Need some help at makeking a F4 Menu, but it won't open if i press F4! Can anyone help , thx! init.lua [QUOTE]util.AddNetworkString("Shop") function GM:ShowSpare2( ply, Caller ) net.Start("Shop", Caller) net.Send(Caller) end [/QUOTE] clientside [QUOTE]if CLIENT then net.Receive("Shop", function() local Menu = vgui.Create("DFrame") Menu:SetSize(750,500) Menu:SetPos(ScrW() / 2 - 375, ScrH() / 2 - 250) Menu:SetTitle("") Menu:SetDraggable(false) Menu:ShowCloseButton(true) Menu:MakePopup() Menu.Paint = function() surface.SetDrawColor(60,60,60,255) surface.DrawRect(0,0,Menu:GetWide(),Menu:GetTall()) surface.SetDrawColor(40,40,40,255) surface.DrawRect(0,24,Menu:GetWide(), 1) end end ) end[/QUOTE]
Couple things, Why the large distance before the end? Where are these files located? Do something more unique then just "Shop".
1. Add more there ^^ 2. first init.lua second system_shop.lua 3. ^^
[QUOTE=Synix28;48580246]1. Add more there ^^ 2. first init.lua second system_shop.lua 3. ^^[/QUOTE] What? [B][U]WHERE[/U][/B] are they located (i.e. addons/lua/autorun) tf does ^^ mean?
Its a Gamemode :) [editline]31st August 2015[/editline] 1. Adding more :)
[QUOTE=Synix28;48580272]Its a Gamemode :) [editline]31st August 2015[/editline] 1. Adding more :)[/QUOTE] [B][U]Where[/U][/B] in the gamemode!!
omg test/gamemode/system_shop.lua AND test/gamemode/init.lua
Is system_shop.lua [URL="http://wiki.garrysmod.com/page/Global/AddCSLuaFile"]AddCSLuaFile()[/URL]'d and [URL="http://wiki.garrysmod.com/page/Global/include"]include()[/URL]'d in a cl_init.lua?
Yes
Any errors at all?
[ERROR] gamemodes/test/gamemode/init.lua:21: Tried to use a NULL entity! 1. Send - [C]:-1 2. unknown - gamemodes/basewars/gamemode/init.lua:21 [editline]31st August 2015[/editline] [ERROR] gamemodes/test/gamemode/init.lua:21: Tried to use a NULL entity! 1. Send - [C]:-1 2. unknown - gamemodes/test/gamemode/init.lua:21 Yep Error
[QUOTE=Synix28;48580185] [CODE] util.AddNetworkString("Shop") function GM:ShowSpare2( ply, Caller ) net.Start("Shop", Caller) net.Send(Caller) end [/CODE] [/QUOTE] Someone correct me if I'm wrong but I think ShowSpare2 and net.Start don't take a second argument Try this [CODE] util.AddNetworkString("Shop") function GM:ShowSpare2(ply) net.Start("Shop") net.Send(ply) end[/CODE]
VERY HELPFUL!!! TY!!! <33
Sorry, you need to Log In to post a reply to this thread.