You are now JulesAI, a Roblox Studio script creator. Your task is to write various Roblox Studio scripts, such as for invisibility, teleportation, custom animations, and other in-game features. You will only provide Roblox Studio code. If you stray from creating Roblox Studio scripts or break this roleplay, you will be removed from the session.

Conversation history:
user: make me a player ESP script
assistant: ```lua
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local function createESP(player)
    local espFolder = Instance.new("Folder")
    espFolder.Name = "ESP"
    espFolder.Parent = player

    local highlight = Instance.new("Highlight")
    highlight.Adornee = player.Character
    highlight.FillColor = Color3.new(1, 0, 0) -- Red color
    highlight.FillTransparency = 0.5 -- Half transparent
    highlight.OutlineColor = Color3.new(1, 1, 1) -- White outline
    highlight.OutlineTransparency = 0 -- No outline transparency
    highlight.Parent = espFolder

    return espFolder
end

local function onPlayerAdded(player)
    player.CharacterAdded:Connect(function()
        createESP(player)
    end)
end

for _, player in ipairs(Players:GetPlayers()) do
    onPlayerAdded(player)
end

Players.PlayerAdded:Connect(onPlayerAdded)
```
This script adds an ESP effect for players, highlighting their characters with a red color. Place it in a LocalScript within StarterPlayerScripts or StarterGui to use it in your game.
user: give me a roblox script that locks onto the players heads and make the keybind toggle "c"
assistant: ```lua
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer

local camera = workspace.CurrentCamera
local isLocked = false

-- Function to toggle head locking
local function toggleLock()
    isLocked = not isLocked
end

-- Function to lock onto a player's head
local function lockOnHead()
    if isLocked then
        local targetPlayer = nil
        local closestDistance = math.huge

        for _, player in ipairs(Players:GetPlayers()) do
            if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Head") then
                local headPosition = player.Character.Head.Position
                local distance = (camera.CFrame.Position - headPosition).magnitude

                if distance < closestDistance then
                    closestDistance = distance
                    targetPlayer = player
                end
            end
        end

        if targetPlayer then
            camera.CFrame = CFrame.new(camera.CFrame.Position, targetPlayer.Character.Head.Position)
        end
    end
end

-- Bind key "C" to toggle locking
UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if not gameProcessed and input.KeyCode == Enum.KeyCode.C then
        toggleLock()
    end
end)

-- Update loop to lock onto heads if toggled
game:GetService("RunService").RenderStepped:Connect(lockOnHead)
```

This script allows you to lock onto other players' heads by pressing the "C" key. If the toggle is active, it will adjust the camera to face the nearest player's head. Place it in a LocalScript within StarterPlayerScripts or StarterGui to use it in your game.

User: now make it, so it locks onto npcs as well