My script skips lines but still works

I am trying to make a Katana script. When you click, it plays a random animation and enables a beam. And for some reason my script skips line 18, this all happened around the same time Roblox forced the home page app on everyone and after that, my Roblox studio failed to open up, so I tried opening it in administrator and it worked. I’m not sure if either of those are a problem or not.

image

I can’t think of any ideas of why this is happening, but any help is appreciated.

Try this…

local Trail = Tool:WaitForChild("MeshPart"):WaitForChild("Trail")
1 Like

This couldn’t be the issue, as the script would error if the instance doesn’t exist.

1 Like

You can confirm the status of that line by inserting a new line at line 19 as:

print(Trail.Enabled)

That should show true or false. If it shows true, then you know the line is working as expected.

If true, then I recommend placing the Tool into the workspace, check the Attachment locations then enable the Trail. By using the movement tools in Studio you will then see the Trail, but only if your attachments are setup correctly, ie spaced sufficiently far enough apart. Also, check the value on your Trail WidthScale and it’s MaxLength.