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

How to Lock-on nearest player target?

Asked by 5 years ago

I can't figure it out, can someone help me, please?

01local uis = game:GetService("UserInputService")
02local player = game.Players.LocalPlayer
03local UiElements = game.ReplicatedStorage.UIElements
04local char=player.Character or player.CharacterAdded:wait()
05local focusing = false
06Target = "placeholder"
07 
08uis.InputBegan:Connect(function(input)
09    if (input.KeyCode == Enum.KeyCode.L) then
10        focusing = not focusing    
11 
12        if (not focusing) then
13 
14            game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
15 
View all 31 lines...

Answer this question