local neck = workspace.Dummy.Head.Neck local NPC = workspace.Dummy function getClosestPlayer() local closest_player, closest_distance = nil, 30 for i, player in pairs(workspace:GetChildren()) do if player:FindFirstChild("Humanoid") and player ~= NPC then local distance = (NPC.PrimaryPart.Position - player.PrimaryPart.Position).Magnitude if distance < closest_distance then closest_player = player closest_distance = distance end end end return closest_player end local cframe0 = neck.C0 while true do local player = getClosestPlayer() if player then local is_in_front = NPC.PrimaryPart.CFrame:ToObjectSpace(player.PrimaryPart.CFrame).Z < 0 if is_in_front then local unit = -(NPC.PrimaryPart.CFrame.p - player.PrimaryPart.Position).unit neck.C0 = cframe0 * CFrame.new(Vector3.new(0, 0, 0), unit) end end wait() end
Title | Name | Language | UNIX | When |
---|---|---|---|---|
Re: Code | Soft Parrot | lua | 1660812371 | 7 Months ago. |
Re: Code | Chartreuse Finch | lua | 1657537668 | 8 Months ago. |
Re: Code | Insensitive Porcupine | lua | 1646151913 | 1 Year ago. |
Re: Code | Melodic Guinea Pig | lua | 1644901128 | 1 Year ago. |
Re: Code | Gamboge Zebra | lua | 1621092834 | 1 Year ago. |
Script ne local | Roblox_game03 | lua | 1616853525 | 1 Year ago. |
Re: Code | Smelly Kitten | lua | 1615719439 | 2 Years ago. |