جرب
obj=createObject(971,0,0,0,0,0,0)
function attaching(asource)
attachElements(obj,asource)
removeCommandHandler("obj",attaching)
addCommandHandler("obj",deattaching)
end
addCommandHandler("obj",attaching)
function deattaching(dsource)
if(getElementAttachedTo(obj)==dsource)then
detachElements(obj,dsource)
if(isTimer(timer)) then killTimer(timer) end
timer=setTimer(
function()
if(getElementAttachedTo(obj)==dsource)then
killTimer(timer)
return nil
end
destroyElement(obj)
end,10000,1
)
end
removeCommandHandler("obj",deattaching)
addCommandHandler("obj",attaching)
end
سيرفر