Knowledgebase » Developers » Things that your script should NOT contain

Here are some things that will instantly get your script denied

  1. Backdoors
    • Nothing should give you or your friends an unfair advantage over other players, or do things that would be considered malicious.
    • What are you, a child?
  2. Non-unique file names
    • All lua folders get mounted into a single lua folder. Your addon doesn't run on its own little island and you shouldn't behave that way. Having something named lua/autorun/init.lua will instantly get your script denied.
  3. Putting all your stuff in _G
    • You should be putting must of your stuff in your own table, and your own table should be unique enough.
    • If you have a function or variable that is NOT local and simply named something similar to SpawnNPC, your script will be denied
  4. SetNW/GetNW functions.
    • These are horribly inefficient. Click here to find out why. Use this or this
    • Data tables are good for entities, net messages are good for one time things or sending stuff to players.
  5. Usermessages
    • There is literally no reason why you should be using them over this
  6. Bad networking practices
    • This includes things like setting DataTable variables or sending net messages too often (for example, in a think hook)
    • Using tostring() on numbers and sending the string instead of simply sending a number.
    • Setting DataTable variables that are never used on the client
    • Sending data to the client which is never used.
  7. Exploitable networking practices
    • net.WriteEntity(LocalPlayer()) is extremely dumb. You should be using the second argument of your net.Receive function to find out who sent the message
    • Assume that anyone can send a net message using the lua_run_cl command at any time.
    • Most of your important calculations should always be done on the server, not on the client
  8. Redundant code
    • If you're copy/pasting something, you should probably use a function or a loop.
    • If you're doing things like something1=2; something2=4; perhaps you should use a loop for that.
  9. "Changing collision rules in a callback is likely to cause crashes!"
    • Do not do anything that would cause this error to appear in console.
    • Things that may cause this error include:
    • Removing an entity in a touch or collision hook
    • Changing physobject properties in a touch or collision hook
  10. Using content that you do not own/have rights to
    • These are things such as models/images/code.
    • If you do not own the rights to these, using them will have your script instantly denied!
  11. Using SendLua
    • Properly network. That's all. No special cases.

Last updated March 21, 2017 00:43 by Nookyava