The error itself says '<eof>' expected near 'end' on line 20. '<eof>' stands for end of file, which means the error is saying that lua was expected the end of the file, but got 'end' instead. To fix, you'll need to check your functions and if statements, and make sure each one lines up with an "end" statement.
One thing to note, indentation helps immensely when coding, so by making sure everything is lined up properly, you can easily spot these errors. All of the code after your "function ITEM:OnEquip(ply, modifications)" is indented twice instead of once. If you fix that, your code will look like:
ITEM.Name = 'Respawn'
ITEM.Price = 20000
ITEM.Model = 'models/xqm/jetengine.mdl'
ITEM.SingleUse = true
ITEM.Except = true
function ITEM:OnEquip(ply, modifications)
if not GetConVarString("gamemode") == "terrortown" then print("Wrong gamemode. Please switch to TTT for this to work.")
end
if v:Alive() then return end
local corpse = corpse_find(v)
if corpse then corpse_remove(corpse) end
v:SpawnForRound( true )
v:SetCredits( ( (v:GetRole() == ROLE_INNOCENT) and 0 ) or GetConVarNumber("ttt_credits_starting") )
end
end
..and now you'll see that you have an extra end on line 20 that can be removed.
Secondly, what you're doing is modifying the "OnEquip" function, which (I assume) is called whenever your item is equipped. The function itself says:
function ITEM:OnEquip(ply, modifications)When this function is called by TTT or whatever, it passes two parameters to your code: ply (the player object), and modifications (not sure, you'd have to look up documentation). Essentially, the first parameter will ALWAYS be the player object, and it will be named based on what you put there. If you want to be named "v", then you would change it to:
function ITEM:OnEquip(v, modifications)Keep in mind that changing to "v" or "ply" or "popsicle" really makes no difference- so long as the rest of your code refers to it the same way, you should be okay.
Hope that helps!