destroy object||doc135438

September 20, 2022

Format

 Object:destroy()
  • The class to which the function belongs:Object

Description

Destroy the object.


Precautions

  • Please do not destroy player-controlled entities on the client side, it will cause unintended consequences

Code Samples

if Object and Object:isValid() then
    Object:destroy()
end