I am going to make a difficulty chart obby on my alt and I do not know how to make a shiftlock, could you tell me how? Please and Thankyou.
I am going to assume you meant how to make a shift lock GUI button, so I recommend checking out this.
Could I just get one from the toolbox?
Or would that be counted as freemodel.
Because I don’t want free models, I’m making my own models.
I don’t ever reccommend getting items from the toolbox ever. it’s safer to just create one yourself.
Did You mean mobile shiftlock?
local SHOW_CENTER_CURSOR = true
local MOBILE_ENABLED = true
local CONSOLE_ENABLED = true
local CONSOLE_BUTTON = Enum.KeyCode.ButtonR2
local UserInputService = game:GetService(“UserInputService”)
local RunService = game:GetService(“RunService”)
local GuiService = game:GetService(“GuiService”)
local Player = game.Players.LocalPlayer
local IsMobile = UserInputService.TouchEnabled
local IsConsole = GuiService:IsTenFootInterface()
local UserGameSettings = UserSettings():GetService(“UserGameSettings”)
local offset = CFrame.new(1.75, 0, 0)
if (IsMobile and MOBILE_ENABLED) or (IsConsole and CONSOLE_ENABLED) then
local Activated = false
local SHIFT_LOCK_OFF = 'rbxasset://textures/ui/mouseLock_off.png'
local SHIFT_LOCK_ON = 'rbxasset://textures/ui/mouseLock_on.png'
local SHIFT_LOCK_CURSOR = 'rbxasset://textures/MouseLockedCursor.png'
local middleFrame = Instance.new('Frame')
middleFrame.Name = "MiddleIcon"
middleFrame.Size = UDim2.new(.075, 0, .075, 0)
middleFrame.Position = UDim2.new(.5, 0, .5, 0)
middleFrame.AnchorPoint = Vector2.new(.5,.5)
middleFrame.BackgroundTransparency = 1
middleFrame.ZIndex = 10
middleFrame.Visible = true
middleFrame.Parent = script.Parent
local MouseLockCursor = Instance.new('ImageLabel')
MouseLockCursor.Name = "MouseLockLabel"
MouseLockCursor.Size = UDim2.new(1, 0, 1, 0)
MouseLockCursor.Position = UDim2.new(0, 0, 0, 0)
MouseLockCursor.BackgroundTransparency = 1
MouseLockCursor.Image = SHIFT_LOCK_CURSOR
MouseLockCursor.Visible = false
MouseLockCursor.Parent = middleFrame
local arc = Instance.new("UIAspectRatioConstraint")
arc.AspectRatio = 1
arc.DominantAxis = "Height"
arc.Parent = middleFrame
if IsMobile and MOBILE_ENABLED then
local frame = Instance.new('Frame')
frame.Name = "BottomLeftControl"
frame.Size = UDim2.new(.1, 0, .1, 0)
frame.Position = UDim2.new(1, 0, 1, 0)
frame.AnchorPoint = Vector2.new(1,1)
frame.BackgroundTransparency = 1
frame.ZIndex = 10
frame.Parent = script.Parent
local ShiftLockIcon = Instance.new('ImageButton')
ShiftLockIcon.Name = "MouseLockLabel"
ShiftLockIcon.Size = UDim2.new(1, 0, 1, 0)
ShiftLockIcon.Position = UDim2.new(-2.775, 0, -1.975, 0)
ShiftLockIcon.BackgroundTransparency = 1
ShiftLockIcon.Image = SHIFT_LOCK_OFF
ShiftLockIcon.Visible = true
ShiftLockIcon.Parent = frame
local arc2 = Instance.new("UIAspectRatioConstraint")
arc2.AspectRatio = 1
arc2.DominantAxis = "Height"
arc2.Parent = frame
ShiftLockIcon.Activated:connect(function()
Activated = not Activated
ShiftLockIcon.Image = Activated and SHIFT_LOCK_ON or SHIFT_LOCK_OFF
MouseLockCursor.Visible = Activated and SHOW_CENTER_CURSOR
end)
end
if IsConsole and CONSOLE_ENABLED then
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == CONSOLE_BUTTON then
Activated = not Activated
MouseLockCursor.Visible = Activated and SHOW_CENTER_CURSOR
end
end)
end
local function OnStep()
if Activated then
UserGameSettings.RotationType = Enum.RotationType.CameraRelative
local Camera = workspace.CurrentCamera
if Camera then
if (Camera.Focus.Position - Camera.CFrame.Position).Magnitude >= 0.99 then
Camera.CFrame = Camera.CFrame * offset
Camera.Focus = CFrame.fromMatrix(Camera.Focus.Position, Camera.CFrame.RightVector, Camera.CFrame.UpVector) * offset
end
end
end
end
RunService:BindToRenderStep("Mobile/ConsoleShiftLock",Enum.RenderPriority.Camera.Value+1,OnStep)
end
Just add Screen Gui and add Localscript