Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I lock shift lock switch so it stays active?

Asked by 6 years ago
Edited 5 years ago

I'm making a survival game and I want the player to stay locked in Shift Lock Switch.

Is there a way to do this?

1 answer

Log in to vote
2
Answered by 6 years ago

Main Idea

Shift Lock is something I learned while making a 3rd person shooter. Shift Lock is ideal in any third person game. Now to do this we will be changing a default roblox camera script.

Step 1Click play. Easy as that. Now go into starter player scripts, and look for the camera script. Copy this script, not the script, right click the Camera Script and click copy. Now click stop. Now go to The Explorer, and go into Starter Player, and click the arrow next to it.

Step 2Paste the Camera Script inside of the StarterPlayerScripts and click the arrow next to the CameraScript.

Step 3Now click open the Root Camera script and go to line 197. There should be a paragraph of script that looks like the following:

this.ShiftLock = false
    this.Enabled = false
    local isFirstPerson = false
    local isRightMouseDown = false
    local isMiddleMouseDown = false
    this.RotateInput = ZERO_VECTOR2
    this.DefaultZoom = LANDSCAPE_DEFAULT_ZOOM
    this.activeGamepad = nil

now on line 197, you change the

this.ShiftLock = false

to

this.ShiftLock = true

Step 4

Now go to line 246 and there should be a paragraph that looks like the following.

function this:GetShiftLock()
        return ShiftLockController:IsShiftLocked()
end

change that line of code to this:

function this:GetShiftLock()
        return true
    end

Now you should be all set.

0
@ Step 3, roblox has added some stuff so it's a bit different. It's not line 197, it's line 200. Also, @ Step 4, not line 246, but line 249. Not trying to be pushy, just clarifying. ReadyHappiness 109 — 6y
Ad

Answer this question