An error I can't seem to find the source of...

Ok well I hate to say it but i am back again…


function arguments expected near 'else'

It is referring to the following if statement:


	if CurTime() > lastspawn then
		lastspawn = CurTime()+10
		itemsactive = itemsactive+1
		local tr = ply:GetEyeTrace() -- tr now contains a trace object
		local ent = ents.Create("prop_physics") -- This creates our entity
		ent:SetPos(tr.HitPos) -- This positions the zombie at the place our trace hit.
		print("You spawned a ")
		print(prop[1])
		ent:SetModel(prop[1]) -- Set model of entity
		ent:Spawn() -- This method spawns the prop
		ent:Activate
	else
	print("You can't do that yet! Try again in "..CurTime()-lastspawn.." seconds.")
	end

I have the print statement to be ran at else…

What am I missing? Does this mean something that I am missing?

Also a related question…

Is there a dictionary of error messages somewhere on the wiki?

[lua] if CurTime() > lastspawn then
lastspawn = CurTime()+10
itemsactive = itemsactive+1
local tr = ply:GetEyeTrace() – tr now contains a trace object
local ent = ents.Create(“prop_physics”) – This creates our entity
ent:SetPos(tr.HitPos) – This positions the zombie at the place our trace hit.
print("You spawned a ")
print(prop[1])
ent:SetModel(prop[1]) – Set model of entity
ent:Spawn() – This method spawns the prop
ent:Activate()
else
print(“You can’t do that yet! Try again in “…CurTime()-lastspawn…” seconds.”)
end[/lua]

You forgot () after ent:Activate

Also, I don’t know if there is a dictionary on the wiki.

There is this page but as of yet it’s very incomplete and not very helpful :

Ah thank you both very much!

I am sorry I post soo many questions here…

This board has questions in it’s name. Ask as many as you need.