Advertisement
NotExotic

Lines Roblox Studio or exploit made my ai for bob ui

Sep 15th, 2023
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. -- Table to store the lines
  2. local lines = {}
  3.  
  4. -- Function to create or update lines from your character to other players
  5. local function updateLinesToPlayers()
  6. local player = game.Players.LocalPlayer -- Get the local player
  7.  
  8. while true do
  9. for _, otherPlayer in pairs(game.Players:GetPlayers()) do
  10. if otherPlayer ~= player then
  11. if player.Character and otherPlayer.Character then
  12. local playerCharacter = player.Character
  13. local otherCharacter = otherPlayer.Character
  14.  
  15. local playerRoot = playerCharacter:FindFirstChild("HumanoidRootPart")
  16. local otherRoot = otherCharacter:FindFirstChild("HumanoidRootPart")
  17.  
  18. if playerRoot and otherRoot then
  19. local lineKey = player.UserId .. "-" .. otherPlayer.UserId -- Unique key for each line
  20. local distance = (otherRoot.Position - playerRoot.Position).Magnitude
  21.  
  22. if lines[lineKey] then
  23. lines[lineKey].Size = Vector3.new(0.1, 0.1, distance)
  24. lines[lineKey].CFrame = CFrame.new(playerRoot.Position, otherRoot.Position) * CFrame.new(0, 0, -distance / 2)
  25. else
  26. local line = Instance.new("Part")
  27. line.Anchored = true
  28. line.CanCollide = false
  29. line.BrickColor = BrickColor.new("Bright red") -- Adjust the color as needed
  30. line.Size = Vector3.new(0.1, 0.1, distance)
  31. line.CFrame = CFrame.new(playerRoot.Position, otherRoot.Position) * CFrame.new(0, 0, -distance / 2)
  32. line.Parent = workspace
  33. lines[lineKey] = line
  34. end
  35. elseif lines[lineKey] then
  36. -- Destroy the line if either player's character is missing
  37. lines[lineKey]:Destroy()
  38. lines[lineKey] = nil
  39. end
  40. end
  41. end
  42. end
  43. wait() -- Update every 1 second (adjust as needed for performance)
  44. end
  45. end
  46.  
  47. -- Start the line updating loop in a separate thread
  48. spawn(updateLinesToPlayers)
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement