A problem with the function GetModel , please, help me
4 replies, posted
I use this code:
local model = self.player:GetModel();
if (model == "models/player/vortigaunt.mdl") then
self.player:GiveSpawnWeapon(player, "swep_vortigaunt_beam");
end
But when I try to verify if the model is correct or not, it doesn't work and I get this error on the console: attempt to call method 'GetModel' (a nil value)(Hook: PlayerSpawn).
Please, somebody can help me?
Thanks for all.
self.player is most likely nil lets see the full code
Here you are:
[url]http://pastebin.com/Ck9vQjcx[/url]
Thanks for help.
[lua]local model = player:GetModel();[/lua]
Most likely
Yea, this was the problem. Thank you!
Sorry, you need to Log In to post a reply to this thread.