I have a script with a lot of lines and I was wondering if there was any way to pin point which exact part of the script is causing the lag? Any and all help is appreciated.
You could add print commands every few lines of code or so, if a long period of time passes between two print commands then you know that the code in between those two print commands is causing the lag.
Try to use the print()
to figure out which part sends an error and attempt to fix it.
Hiya.
Many different debugging features are included within the Roblox Lua Scripting Language.
A specific and easy to use one is print.
Simple, if the statement has the output of what you printed, you know that the code is running. For example:
if player.Name == "YourName" then
print("Woah! It's them!!!")
end
Other options are using pcalls to catch errors, alongside many other debugging features, all included within the Roblox API site.
All my code runs fine the issue is that a certain part of my code causes massive server lag. Iām trying to find which part is causing the lag so I can fix it.