How would you make a script where if you’d equip a tool, your camera would shiftlock (just like in a lot of third person shooters)

  1. What do you want to achieve? Keep it simple and clear!

If you haven’t read the title, I am trying to achieve making a script that would shiftlock your camera whenever you’d equip a tool

  1. What is the issue? Include screenshots / videos if possible!

I tried the stupidest method where I grabbed a shiftlock script, put it in a tool and made it so that when you equip the gun it enables the script (disable and enable = true or smth like that). Yes, i know that’s stupid because i do not know how to script a lot.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried looking around on devforum but all I could find were a couple of unhelpful topics and such.
I’ve also tried using module scripts and local scripts but usually end up with a broken script or something with the same result.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Script probably went like this:

Local camera = script.Camerascript
Local tool = script.parent

tool.equipped:Connect(function()
      camera.Enabled = true
end)

tool.unequipped:Connect(function()
      camera.enabled = false
end)