Uh, that’s weird. But really, you don’t even need LocalPlayer() in there, you can do this instead:
if ( !IsValid( buyMenu ) ) then
buyMenu = vgui.CreateFromTable( vgui_Splash )
buyMenu:SetHeaderText( “The Shop” )
buyMenu:SetHoverText( “yeah” )
local function1 = function() client:Give( "weapon_shotgun" ) end
local Button = buyMenu:AddSelectButton( "Shotgun", function1 )
Button.m_colBackground = Color( 255, 90, 90, 255 )
local function2 = function() client:GiveAmmo( 30, "buckshot" ) end
local Button2 = buyMenu:AddSelectButton( "Shotgun Ammo", function2 )
Button2.m_colBackground = Color( 255, 90, 90, 255 )
Button2.Think = function( self )
self:SetDisabled( !client:HasWeapon( "weapon_shotgun" ) )
concommand.Add( “BuyMenu”, function(pl) GAMEMODE:ShowBuyMenu(pl) end )
Oh, also I just noticed something, I doubt Give and GiveAmmo work clientside, you’ll need to set up a serverside console command, and execute it from the client. Of course, make sure to check how much money the player has (serverside, that is).
Have you tried adding debug lines like print(LocalPlayer()) to get a better eye on what’s going on? Either way it shouldn’t work - clientside scripts for obvious reasons can’t give a player ammo or weapons. And you should really paste any errors you’re getting.