For Some Reason My Script Won't Work

For some reason my script won’t work, it is supposed to disable swimming after using gear but it will not work but when I have it not disabled when I start it works and I don’t know why.
Screenshot 2021-01-17 171749 Screenshot 2021-01-17 171830

From the image I see that you placed the local script it in ReplicatedStorage as it’s above the blue blip which I’m assuming is a server script service.

Local scripts:

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

  • A Player’s Backpack , such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts .
  • The ReplicatedFirst service

Also, make sure to post the script next time using three back ticks in between the code ``` to format it properly like so:

print("hello world")

Also it helps us a-lot to help you debug your code.

I looked more and I made it so the separate script was part of the gear script and now it works

I found the problem but thanks for helping anyways!