Hello fellow developers! I’m Nick and I’m trying to make a TPS gun but with shift lock (similar to some SCP weapons) but I am not sure how, I tried the Attach CameraType but it didn’t look good, and I didn’t find any video tutorials about it either, does anyone know how to make is shift lock only?
Its called “Forced Shift Lock. a thing that forces players to use shift lock for the reason like you said above”.
Okay there is solution.
First, open studio and go into the game you want to force it in. Next, hit Play under the Test tab and make sure you have the Explorer toggled ON under the View tab. In the explorer, navigate to:
Copy this to the clipboard. Now stop the play test. Paste it into the Workspace or an area of your choosing (I will use the Workspace for the example).
Right-Click either StarterGui , StarterPlayer or StarterPack in the Explorer , click Insert Object and then find Local Script . Once this has been created, open it up and paste in the following lines of code:
game.Players.LocalPlayer.PlayerScripts:WaitForChild("CameraScript"):Destroy()
game.Workspace.CameraScript.Parent = game.Players.LocalPlayer.PlayerScripts
If you stored your CameraScript somewhere else, change “game.Workspace” to wherever you put it.
EDIT: this will work only once and for only one player, to change this you need to change some code: instead of
game.Workspace.CameraScript.Parent = game.Players.LocalPlayer.PlayerScripts
do the following:
local script = game.Workspace.CameraScript:Clone()
script.Parent = game.Players.LocalPlayer.PlayerScripts
This should force players into shiftlock.
I don’t think CameraScripts are still found in PlayerScripts https://gyazo.com/f225e0946622ba8e79c3864463402f60
Its in player module. Hope it works!
If you want the camera to be activated when you equip a tool, this should help. But if you want it automatically set to shiftlock, read on this, the following script should help.
Thank you so much! I really appreciate the help!
You read my mind lol over-the-shoulder was what i was just looking for! Thanks alot man!