General > Developers Corner

My first lua script is wrong

(1/1)

Professor_Smiley:
function Weaponz()
   if Player:IsAdmin() then
      Player:Give("weapon_mu_magnum")
      Player:Give("weapon_mu_knife")
      Player:Give("weapon_smg1")
   end
end

concommand.Add ( "weps", Weaponz )

[ERROR] lua/autorun/weaponz.lua:2: attempt to index global 'Player' (a function value)
  1. unknown - lua/autorun/weaponz.lua:2
   2. unknown - lua/includes/modules/concommand.lua:54

Help?

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version