chore: refractor
This commit is contained in:
27
StarterGui/Crosshair/LocalScript.client.lua
Normal file
27
StarterGui/Crosshair/LocalScript.client.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
-- 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)
|
||||
4
StarterGui/Crosshair/init.meta.json
Normal file
4
StarterGui/Crosshair/init.meta.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"className": "ScreenGui",
|
||||
"ignoreUnknownInstances": true
|
||||
}
|
||||
Reference in New Issue
Block a user