UDP flashlight working and fix some type errors

This commit is contained in:
2024-03-02 02:58:45 -05:00
parent dd5677daa0
commit 0d08e341b2
13 changed files with 158 additions and 132 deletions

View File

@@ -9,9 +9,9 @@ local HealthSettings = require(UI:WaitForChild("Health"))
local CoreGuis = require(script:WaitForChild("CoreGuis"))
local Mouse = require(script:WaitForChild("Mouse"))
local Players = game:GetService("Players")
local Storage = game:GetService("ReplicatedStorage")
local RS = game:GetService("RunService") :: RunService
local Players: Players = game:GetService("Players")
local Storage: ReplicatedStorage = game:GetService("ReplicatedStorage")
local RS: RunService = game:GetService("RunService")
local ClientStorage = Storage:WaitForChild("Client")
local LoadCompleted = ClientStorage:WaitForChild("LoadingComplete")
@@ -19,11 +19,11 @@ local KeyBindsModule = require(ClientStorage:WaitForChild("KeyBinds"))
local CameraSettings = require(ClientStorage:WaitForChild("Camera"))
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local PlayerGui = Player:WaitForChild("PlayerGui") :: PlayerGui
--We need to wait for the game to load before spamming functionality
repeat
local GameIsLoaded = LoadCompleted:Invoke()
local GameIsLoaded = (LoadCompleted :: BindableFunction):Invoke()
task.wait()
until GameIsLoaded
@@ -41,10 +41,10 @@ local Crosshair = CrosshairSettings.constructor(PlayerGui)
local function CameraBinds()
local CameraBindMap = KeyBindsModule.constructor(false)
CameraBindMap:AddInputBegan({Enum.KeyCode.C, Enum.KeyCode.Z}, function()
CameraBindMap:AddInputBegan({Enum.KeyCode.C, Enum.KeyCode.Z}, function(_KeyPressed)
Camera:ZoomIn(Vignette, Crosshair)
end)
CameraBindMap:AddInputEnded({Enum.KeyCode.C, Enum.KeyCode.Z}, function()
CameraBindMap:AddInputEnded({Enum.KeyCode.C, Enum.KeyCode.Z}, function(_KeyPressed)
Camera:ZoomOut(Vignette, Crosshair)
end)
end