Advertisement
refrop

humanoid name detector parent

Jun 13th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. local runDummyScript = function(f,scri)
  2. local oldenv = getfenv(f)
  3. local newenv = setmetatable({}, {
  4. __index = function(_, k)
  5. if k:lower() == 'script' then
  6. return script
  7. else
  8. return oldenv[k]
  9. end
  10. end
  11. })
  12. setfenv(f, newenv)
  13. ypcall(function() f() end)
  14. end
  15.  
  16.  
  17. cors = {}
  18. Wo = Instance.new("Model",game:GetService("Lighting"))
  19. Wo.Name = "CompiledModel"
  20.  
  21. -----variables
  22.  
  23.  
  24.  
  25. local base = Instance.new("Part")
  26. base.Name = "humanoiddetector"
  27.  
  28. local Bi = Instance.new("BillboardGui")
  29.  
  30. local text = Instance.new("TextBox")
  31.  
  32. local runner = game.Workspace:WaitForChild("refrop")
  33.  
  34. -----variables
  35.  
  36. -----game
  37.  
  38. wait(0.2)
  39. local W = Wo
  40.  
  41. base.Parent = W
  42. base.Position = runner.Torso.Position + Vector3.new(0, 1, 0)
  43. base.Orientation = Vector3.new(0, 0, 0)
  44. base.Size = Vector3.new(10.51, 7.321, 11.44)
  45. base.Anchored = true
  46. base.BrickColor = BrickColor.new("Sage green")
  47. base.Material = Enum.Material.Neon
  48. base.Transparency = 0.5
  49. base.CanCollide = false
  50.  
  51.  
  52. Bi.Parent = base
  53. Bi.AlwaysOnTop = true
  54. Bi.Enabled = true
  55. Bi.Size = UDim2.new(0, 200, 0, 50)
  56.  
  57. text.Parent = Bi
  58. text.TextScaled = true
  59. text.BackgroundTransparency = 1
  60. text.Text = "Searching..."
  61. text.Size = UDim2.new(1, 0, 1, 0)
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. -----game
  72.  
  73.  
  74.  
  75. -----final
  76.  
  77. Wo.Parent = workspace
  78. Wo:MakeJoints()
  79. local mas1 = Wo:GetChildren()
  80. for i=1,#mas1 do
  81. mas1[i].Parent = workspace
  82. ypcall(function() mas1[i]:MakeJoints() end)
  83. end
  84. Wo:Destroy()
  85. for i=1,#cors do
  86. coroutine.resume(cors[i])
  87. end
  88.  
  89. -----final
  90.  
  91. -----functions
  92.  
  93. game.Workspace.humanoiddetector.Touched:Connect(function(hit)
  94.  
  95. local char = hit.Parent
  96.  
  97. if char.Humanoid then
  98.  
  99.  
  100. local humanoid = char.Parent.Name
  101.  
  102.  
  103. if (humanoid ~= nil) then -- if a humanoid exists, then
  104. game.Workspace.humanoiddetector.BillboardGui.TextBox.Text = humanoid -- damage the humanoid
  105. end
  106. end
  107. wait(10)
  108. game.Workspace.humanoiddetector:destroy()
  109.  
  110. end)
  111.  
  112. -----functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement