HAIMA

ESP MM2

Jan 26th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.33 KB | None | 0 0
  1. local LP = game.Players.LocalPlayer
  2. local Players = game:GetService("Players")
  3. local gsCoreGui = game.CoreGui
  4.  
  5. local function ExposeMurderer(Player)
  6. print(Player.ClassName)
  7. local AboveHead = Instance.new("BillboardGui")
  8. AboveHead.Parent = gsCoreGui
  9. if Player.ClassName == "Model" then
  10. AboveHead.Adornee = Player.Head
  11. elseif Player.ClassName == "Player" then
  12. AboveHead.Adornee = Player.Character.Head
  13. end
  14. AboveHead.Name = "rGET"..Player.Name
  15. AboveHead.Size = UDim2.new(0, 100, 0, 100)
  16. AboveHead.StudsOffset = Vector3.new(0, 1, 0)
  17. AboveHead.AlwaysOnTop = true
  18. local Info = Instance.new("TextLabel")
  19. Info.Parent = AboveHead
  20. Info.BackgroundTransparency = 1
  21. Info.Position = UDim2.new(0, 0, 0, 0)
  22. Info.Size = UDim2.new(1, 0, 0, 40)
  23. Info.TextColor3 = Color3.fromRGB(200,200,200)
  24. Info.TextStrokeTransparency = 0.5
  25. Info.TextSize = 15
  26. Info.Text = "Murderer: "..Player.Name
  27. Info.TextStrokeColor3 = Color3.fromRGB(255, 0, 0)
  28.  
  29. if Player.ClassName == "Model" then
  30. Player.Humanoid.Died:Connect(function()
  31. current = false
  32. AboveHead:Destroy()
  33. end)
  34. else
  35. Player.Character.Humanoid.Died:Connect(function()
  36. current = false
  37. AboveHead:Destroy()
  38. end)
  39. end
  40.  
  41. Players.PlayerRemoving:Connect(function(plr)
  42. if plr == Player.Name then
  43. current = false
  44. AboveHead:Destroy()
  45. end
  46. end)
  47. end
  48.  
  49. local function RevealSheriff(Player)
  50. print(Player.ClassName)
  51. local AboveHead = Instance.new("BillboardGui")
  52. AboveHead.Parent = gsCoreGui
  53. if Player.ClassName == "Model" then
  54. AboveHead.Adornee = Player.Head
  55. elseif Player.ClassName == "Player" then
  56. AboveHead.Adornee = Player.Character.Head
  57. end
  58. AboveHead.Name = "rGET"..Player.Name
  59. AboveHead.Size = UDim2.new(0, 100, 0, 100)
  60. AboveHead.StudsOffset = Vector3.new(0, 1, 0)
  61. AboveHead.AlwaysOnTop = true
  62. local Info = Instance.new("TextLabel")
  63. Info.Parent = AboveHead
  64. Info.BackgroundTransparency = 1
  65. Info.Position = UDim2.new(0, 0, 0, 0)
  66. Info.Size = UDim2.new(1, 0, 0, 40)
  67. Info.TextColor3 = Color3.fromRGB(200,200,200)
  68. Info.TextStrokeTransparency = 0.5
  69. Info.TextSize = 15
  70. Info.Text = "Sheriff: "..Player.Name
  71. Info.TextStrokeColor3 = Color3.fromRGB(0, 0, 255)
  72.  
  73. if Player.ClassName == "Model" then
  74. Player.Humanoid.Died:Connect(function()
  75. current = false
  76. AboveHead:Destroy()
  77. end)
  78. else
  79. Player.Character.Humanoid.Died:Connect(function()
  80. current = false
  81. AboveHead:Destroy()
  82. end)
  83. end
  84.  
  85. Players.PlayerRemoving:Connect(function(plr)
  86. if plr == Player.Name then
  87. current = false
  88. AboveHead:Destroy()
  89. end
  90. end)
  91. end
  92.  
  93. for i,v in pairs(game:GetDescendants()) do
  94. if v.ClassName == "Tool" then
  95. if v.Name == "Knife" then
  96. print(v.Parent.Name)
  97. if v.Parent.Name == "Backpack" then
  98. ExposeMurderer(v.Parent.Parent)
  99. else
  100. ExposeMurderer(v.Parent)
  101. end
  102. elseif v.Name == "Gun" then
  103. print(v.Parent.Name)
  104. if v.Parent.Name == "Backpack" then
  105. RevealSheriff(v.Parent.Parent)
  106. else
  107. RevealSheriff(v.Parent)
  108. end
  109. end
  110. end
  111. end
  112. -- -----------------------------------
  113. -- ___ _ _ _ --
  114. -- / __| ___| |_| |_(_)_ _ __ _ ___--
  115. -- \__ \/ -_) _| _| | ' \/ _` (_-<--
  116. -- |___/\___|\__|\__|_|_||_\__, /__/--
  117. -- |___/ --
  118. -- -----------------------------------
  119. -- -----------------------------------
  120. ALLYCOLOR = {120,120,120} --//Color of the ESP of people on the same team
  121. ENEMYCOLOR = {120,120,120} --//Color of the ESP of people on NOT the same team
  122. TRANSPARENCY = 0.7 --//Transparency of the ESP
  123. HEALTHBAR_ACTIVATED = false --//Renders the Healthbar
  124. --
  125. --
  126.  
  127. -- !!!Don't Change Anything Below Here Unless You Know What You're Doing!!!
  128.  
  129. function createFlex()
  130. -- -----------------------------------------------------------------------------------
  131. --[VARIABLES] //Changing may result in Errors!
  132. players = game:GetService("Players") --//Required for PF
  133. faces = {"Front","Back","Bottom","Left","Right","Top"} --//Every possible Enum face
  134. currentPlayer = nil --//Used for the Team-Check
  135. lplayer = players.LocalPlayer --//The LocalPlayer
  136. -- -----------------------------------------------------------------------------------
  137. players.PlayerAdded:Connect(function(p)
  138. currentPlayer = p
  139. p.CharacterAdded:Connect(function(character) --//For when a new Player joins the game
  140. createESP(character)
  141. end)
  142. end)
  143. -- -----------------------------------------------------------------------------------
  144. function checkPart(obj) if (obj:IsA("Part") or obj:IsA("MeshPart")) and obj.Name~="HumanoidRootPart" then return true end end --//Check if the Part is suitable
  145. -- -----------------------------------------------------------------------------------
  146. function actualESP(obj)
  147.  
  148. for i=0,5 do
  149. surface = Instance.new("SurfaceGui",obj) --//Creates the SurfaceGui
  150. surface.Face = Enum.NormalId[faces[i+1]] --//Adjusts the Face and chooses from the face table
  151. surface.AlwaysOnTop = true
  152.  
  153. frame = Instance.new("Frame",surface) --//Creates the viewable Frame
  154. frame.Size = UDim2.new(1,0,1,0)
  155. frame.BorderSizePixel = 0
  156. frame.BackgroundTransparency = TRANSPARENCY
  157. if currentPlayer.Team == players.LocalPlayer.Team then --//Checks the Players Team
  158. frame.BackgroundColor3 = Color3.new(ALLYCOLOR[1],ALLYCOLOR[2],ALLYCOLOR[3]) --//If in same Team
  159. else
  160. frame.BackgroundColor3 = Color3.new(ENEMYCOLOR[1],ENEMYCOLOR[2],ENEMYCOLOR[3]) --//If in another Team
  161. end
  162.  
  163. end
  164. end
  165. -- -----------------------------------------------------------------------------------
  166. function createHealthbar(hrp)
  167. board =Instance.new("BillboardGui",hrp) --//Creates the BillboardGui with HumanoidRootPart as the Parent
  168. board.Name = "total"
  169. board.Size = UDim2.new(1,0,1,0)
  170. board.StudsOffset = Vector3.new(3,1,0)
  171. board.AlwaysOnTop = true
  172.  
  173. bar = Instance.new("Frame",board) --//Creates the red background
  174. bar.BackgroundColor3 = Color3.new(255,0,0)
  175. bar.BorderSizePixel = 0
  176. bar.Size = UDim2.new(0.2,0,4,0)
  177. bar.Name = "total2"
  178.  
  179. health = Instance.new("Frame",bar) --//Creates the changing green Frame
  180. health.BackgroundColor3 = Color3.new(0,255,0)
  181. health.BorderSizePixel = 0
  182. health.Size = UDim2.new(1,0,hrp.Parent.Humanoid.Health/100,0)
  183. hrp.Parent.Humanoid.Changed:Connect(function(property) --//Triggers when any Property changed
  184. hrp.total.total2.Frame.Size = UDim2.new(1,0,hrp.Parent.Humanoid.Health/100,0) --//Adjusts the size of the green Frame
  185. end)
  186. end
  187. -- -----------------------------------------------------------------------------------
  188. function createESP(c) --//Checks and calls the proper function
  189. bugfix = c:WaitForChild("Head") --// *Used so the children of the character arent nil.
  190. for i,v in pairs(c:GetChildren()) do
  191. if checkPart(v) then
  192. actualESP(v)
  193. end
  194. end
  195. if HEALTHBAR_ACTIVATED then --//If the user decided to
  196. createHealthbar(c:WaitForChild("HumanoidRootPart")) --//Calls the function of the creation
  197. end
  198. end
  199. -- -----------------------------------------------------------------------------------
  200. for i,people in pairs(players:GetChildren())do
  201. if people ~= players.LocalPlayer then
  202. currentPlayer = people
  203. --//Used for Players already in the Game
  204. createESP(people.Character)
  205. people.CharacterAdded:Connect(function(character)
  206. createESP(character)
  207. end)
  208. end
  209. end
  210. -- -----------------------------------------------------------------------------------
  211. end --//End of the entire function
  212.  
  213. createFlex() --// Does exactly that :)
Add Comment
Please, Sign In to add comment