Common mistakes blog


  • I think it would be a great idea to have a blog post with all of the common mistakes/misconceptions about how things work in Lua/Roblox. The way that would be done is people would reply to this post of mine with what they have seen as a common error. Then, they would post their explanation/solution of/to the problem. Then I would take all the responses and edit/tidy them up and post them as an article under the name of Common Mistakes and their Solutions or something like that. I will go first in posting a common error and its solution in this thread: Often people assume that a computer's syntax works like our syntax:

    local name = "bob"
    if name == "rob" or "steve" then
    -- code
    end
    

    The computer will always see this as true. Why? Because it is doing something like two if statements with that or

    if (name == "rob") or ("steve") then
    

    because strings are truthy in Lua, it calculates "steve" to be true and lets the if statement pass. Computers do not think like humans do.

    The above is just an example, and a terrible one at that. I am rather exhausted and not willing to put in the work rn. If this idea does turn out, I will edit everything to be ship shape and easily understood/read. Please tell me if you think this would be a good idea and if so please post something you see that is a common problem that can be easily solved.


  • @Phlegethon5778 there is a blog post but it needs newer mistakes like the one you posted. https://scriptinghelpers.org/blog/common-mistakes


  • @incapaz I knew that, that is why I am posting this.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.