It works weird, but:
function onScriptLoad()
{
ShowMouseCursor(true);
fDepth <- 10.0;
}
function onClientMouseClick(button, down, x, y)
{
if (down)
{
local pos = ScreenPosToWorld(VectorScreen(x, y), fDepth);
CallServerFunc(YOUR_PATH_HERE, "CreateObject2", 1344, pos.x, pos.y, pos.z);
}
}
RegisterRemoteFunc("CreateObject2");
function CreateObject2(model, x, y, z) { CreateObject(model, Vector(x,y,z)); } //CallServerFunc doesn't work w/ Vector class, no idea why