Files
block-game/StarterGui/Crosshair/LocalScript.client.lua
2026-01-08 22:58:58 +02:00

28 lines
898 B
Lua

-- force first person mode on the person's camera
if not game:IsLoaded() then
game.Loaded:Wait()
end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local TXTS = game:GetService("TextChatService")
local TXTS_CIF = TXTS:FindFirstChildOfClass("ChatInputBarConfiguration")
local objects = ReplicatedStorage:WaitForChild("Objects", 9e9)
objects:WaitForChild("MLLoaded", 9e9)
objects:WaitForChild("CSMLLoaded", 9e9)
game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
UIS.MouseIconEnabled = false
UIS.InputEnded:Connect(function(k)
if k.KeyCode == Enum.KeyCode.M and UIS:GetFocusedTextBox() == nil and not TXTS_CIF.IsFocused then
local v = not script.Parent.DummyButton.Modal
UIS.MouseIconEnabled = v
script.Parent.CrosshairLabel.Visible = not v
script.Parent.DummyButton.Modal = v
end
end)