people always tell me that i should but i'm a begginer. would i print something on the line after the suspicous line of code? any help appreciated
You can use Print() to debug.
Example Of Debugging With Print:
local part = workspace.Part -- Defining "part" if part then -- if part exists then print("part exists") -- print "part exists" end
By working the logic in your brain that, "part exists" will only be printed if part does exist, then you can conclude that the part does not exist, only if "part exists" does not print. But, if "part exists" does print, then part does exist.
Quick Simple tutorial
--Lets say we are doing something here we don't know if it is working or has any signs [Of course this will not work. It is just an example] local l = v --Since v is undefined. It will return an error in console print("Working") --Seeing "Working" In console means that the code above worked.
So first it matters on your error.
If you mistyped something, it will get you an error in the output and you can just correct it. Thats the easiest error.
But if you didn't mistype anthing, you have no error in your output and your script isn't working, then you can use printing or if-statements.
As beginner, you don't really need to be good at debugging stuff, just ask others or here, in ScriptingHelpers and people will most likely answer your question.
Try to make if-then statements either before or after the suspicious line of code, and within your function print something if it returns true, and if it doesn't print you can continue to debug your line of code.