Ok im trying to make a teleport function for admins on my server, but when i start the server with the tp code it shutsdown before the server contacts steams servers.
the code for the tp:
function TP(ply, text)
local Array = string.Explode( " ", text );
if Array[1] == "/goto" && ply:IsAdmin() then
for k , t in ipairs(player.GetAll()) do
if string.find(string.lower(t:Nick()) , string.lower(Array[2])) then
WriteToLog( ply:GetName() .." Teleported to " .. t:Nick());
local vec1 = Vector(50,50,50);
local vec2 = t:GetPos();
--local vec3 = vec2:Add(vec1);
t:SetPos(vec1 + vec2);
else
ply:PrintMessage( HUD_PRINTTALK, "Player name wasnt valid!");
end
end
return false
end
end
hook.Add( "PlayerSay", "TP", TP)
anyone that knows why the server shutsdown right on start?
i got a screenshot right before the server shutsdown, it goes so fast that you cant see all errors but you can try.
This just happens when i add this code!
Please Help!