Player:Say not working

I have in the file but all I get is

	function SWEP:SecondaryAttack( ply )
	self:SetNextSecondaryFire( CurTime() + self.Secondary.Delay )
		homg = PrintTable( player.GetAll() )
		print ( homg )
		if ( !self:CanSecondaryAttack() ) == true then
			Player:Say( "Opening Dimension", true )
		
		return " "
		
		
		end
		if(Player:Alive(true)) then
		
		
		end
		
		
		

	end

The Error I get is
[ERROR] addons/custom/lua/weapons/weapon_test.lua:64: attempt to index global ‘Player’ (a function value)

  1. unknown - addons/custom/lua/weapons/weapon_test.lua:64

but no matter what I change nothing happens, I’m really just trying to get a swep to open a gui but with the work around im using if this doesn’t work idk what will

Any Help is appreciated.

The Help is appreciated. :smiley:

Player needs to be a player object.

Replace your 2 “Player” by “ply” ?

If you want to get the player holding the SWEP, use self.Owner.
Try doing:



self.Owner:Say("Opening Dimension", true)


You see how at the top you define ply and them never use it. You can’t use player but must use ply. If at the too you had cheese you would use cheese:Say. Because you’re usinga weapon though stick with self.Owner (so self.Owner:Say)