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

How can i make a shift lock button?

Asked by 4 years ago

So I am trying to do a third person shooter and i will use Shift Lock for that, but I have a main GUI, and they need to press DEPLOY, but they cannot because its already shift locked. Can I make it un shift locked in the menu and when they press DEPLOY to actually have a third person camera?

1 answer

Log in to vote
0
Answered by
uhi_o 417 Moderation Voter
4 years ago
Edited 4 years ago

https://devforum.roblox.com/t/how-to-make-touch-screen-mobile-device-screen-shift-lock-button-how-to-enable-shift-lock-while-clicking-with-different-buttons/642770

You would need a bool value called "isShiftlock" in the player object. Then just set the bool value to true then false for whenever you want to enable/disable it

How to Enable Shift lock while Clicking With Different Buttons First, Go into game in studio go into your player then go into Player Scripts You will find Player Module You will need to Copy That. End that test session and paste it into this directory game.StarterPlayer.StarterPlayerScripts Paste it there Go into CameraModule and Find the First child of that called “MouseLockController” Go into the script down to line 28 where you set the keys on what you wan to bind it to. It should say

self.boundKeys = {Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift} -- defaults

When you want to add more add a comma and then add you key Bind I did Left trigger on Xbox Controller

self.boundKeys = {Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift, Enum.KeyCode.ButtonL2}

This post was written following the post linked above.

Ad

Answer this question