Guest User

Untitled

a guest
Jul 13th, 2011
36
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wModify ( source, command, modType, value )
  2.     local pData = getElementData ( source, "selection" )
  3.     if pData == nil then
  4.         outputChatBox ( "You must have and object selected before attempting to alter it.", source )
  5.     else
  6.         if value == nil then
  7.             outputChatBox ( "Please enter a value to modify your object by.", source )
  8.         else
  9.             local x, y, z, rx, ry, rz = getElementAttachedOffsets ( pData )
  10.             if modType == "x" then
  11.                 setElementAttachedOffsets ( pData, x + value, y, z, rx, ry, rz )
  12.             elseif modType == "y" then
  13.                 setElementAttachedOffsets ( pData, x, y + value, z, rx, ry, rz )
  14.             elseif modType == "z" then
  15.                 setElementAttachedOffsets ( pData, x, y, z + value, rx, ry, rz )
  16.             elseif modType == "rx" then
  17.                 setElementAttachedOffsets ( pData, x, y, z, rx + value, ry, rz )
  18.             elseif modType == "ry" then
  19.                 setElementAttachedOffsets ( pData, x, y, z, rx, ry + value, rz )
  20.             elseif modType == "rz" then
  21.                 setElementAttachedOffsets ( pData, x, y, z, rx, ry, rz + value )
  22.             elseif modType == nil then
  23.                 outputChatBox ( "You need to choose an axis / rotation axis to modify the object on.", source )
  24.             else
  25.                 outputChatBox ( "Please use correct values when choosing your modification type.", source )
  26.             end
  27.         end
  28.     end
  29. end
RAW Paste Data