Hello,
I have tryed to make an npc spawn script for my gamemode, it's look like this:
------------------------------------------------------------------------------------------------
function zombiespawn ()
local z=ents.Create ("npc_zombie")
z:SetPos( ZombSpawn )
z:Spawn()
z:SetColor(Color(255,0,0))
end
ZombSpawn = {}
ZombSpawn[1] = ( Vector (3664.375244, 2457.037354, 115.313522) )
timer.Simple ( "ZombieTimer", 20, 0, zombiespawn )
--------------------------------------------------------------------------------------------------
but when i launch it, i have this message:
--------------------------------------------------------------------------------------------------
[ERROR] gamemodes/0/gamemode/monster_spawn.lua:3: attempt to call field 'Create'
(a nil value)
-------------------------------------------------------------------------------------------------
Can someone help?
Thank you.
Please use [CODE] tags for code else it is hard to read.
[editline]6th April 2015[/editline]
Where are you running this code?
In an lua file called zombie_spawn.lua in my gamemode folder
[QUOTE=Abinox01;47467788]In an lua file called zombie_spawn.lua in my gamemode folder[/QUOTE]
Are you running this server side. ents.Create can only be called serverside not clientside.
it's ok i find the problems thank you for your help
Sorry, you need to Log In to post a reply to this thread.