Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --i need a locking script that works in hood spirit FFA, not a cam lock, make it a tool in my inventory, dot lock or bubble doesn't matter i just need to see who im locked on , works on mobile, also isnt detected
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local LocalPlayer = Players.LocalPlayer
- local mouse = LocalPlayer:GetMouse()
- local loxkedplr
- local lockDot
- local clickConnection
- -- Function to create a red dot
- local function createRedDot()
- local dot = Instance.new("Part")
- dot.Size = Vector3.new(1.5, 1.5, 1.5) -- Slightly smaller than 🔴 emoji
- dot.Shape = Enum.PartType.Ball
- dot.BrickColor = BrickColor.new("Bright red")
- dot.Anchored = true
- dot.CanCollide = false
- dot.Transparency = 0.5
- dot.Parent = workspace
- return dot
- end
- local function uh(title, text)
- game.StarterGui:SetCore("SendNotification", {
- Title = title;
- Text = text;
- Duration = 3;
- })
- end
- -- Function to lock onto a player
- local function lockOntoPlayer(player)
- loxkedplr = player
- if lockDot then
- lockDot:Destroy()
- end
- lockDot = createRedDot()
- uh("Locked On", "You are now locked onto " .. player.Name)
- end
- -- Create the tool
- local tool = Instance.new("Tool")
- tool.Name = "Pinky loxk"
- tool.RequiresHandle = false
- tool.CanBeDropped = false
- -- Equip and unequip events
- tool.Equipped:Connect(function()
- clickConnection = mouse.Button1Down:Connect(function()
- if mouse.Target and mouse.Target.Parent then
- local klixkedplr = Players:GetPlayerFromCharacter(mouse.Target.Parent)
- if klixkedplr and klixkedplr ~= LocalPlayer then
- lockOntoPlayer(klixkedplr)
- end;end
- end)
- UserInputService.TouchTap:Connect(function(touchPositions, uip)
- if not uip then
- local touchPosition = touchPositions[1]
- local ray = workspace.CurrentCamera:ScreenPointToRay(touchPosition.X, touchPosition.Y)
- local hit, position = workspace:FindPartOnRay(ray, LocalPlayer.Character)
- if hit and hit.Parent then
- local klixkedpl = Players:GetPlayerFromCharacter(hit.Parent)
- if klixkedpl and klixkedpl ~= LocalPlayer then
- lockOntoPlayer(klixkedpl)
- end
- end
- end
- end)
- end)
- tool.Unequipped:Connect(function()
- if clickConnection then
- clickConnection:Disconnect()
- end
- end)
- -- Follow the locked player with the red dot
- RunService.RenderStepped:Connect(function()
- if loxkedplr and loxkedplr.Character and lockDot then
- local torso = loxkedplr.Character:FindFirstChild("HumanoidRootPart")
- if torso then
- local velocity = torso.Velocity
- local prediction = torso.Position + velocity * 0.1
- lockDot.Position = prediction + Vector3.new(0, 2, 0)
- end
- end
- end)
- tool.Parent = LocalPlayer.Backpack
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement