Advertisement
eesportspbin

ee ss pp

May 14th, 2023 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. local LatestRoom = game.ReplicatedStorage.GameData.LatestRoom
  2. local ESP = false
  3. local Character = game.Players.LocalPlayer.Character
  4.  
  5. LatestRoom:GetPropertyChangedSignal("Value"):Connect(function(value)
  6. ESP = value
  7. updateESP()
  8. end)
  9.  
  10. function updateESP()
  11. local RoomNumber = math.clamp(LatestRoom.Value, 0, 99)
  12. local HighlightParent = workspace.CurrentRooms[tostring(RoomNumber)].Door.Door
  13.  
  14. local HighlightChild = HighlightParent:FindFirstChild("DoorESP_Highlight")
  15. if not HighlightChild then
  16. HighlightChild = Instance.new("Highlight")
  17. HighlightChild.Name = "DoorESP_Highlight"
  18. HighlightChild.Parent = HighlightParent
  19. HighlightChild.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  20. end
  21.  
  22. local BillboardGui = HighlightParent:FindFirstChild("DoorESP_BillboardGui")
  23. if not BillboardGui then
  24. BillboardGui = Instance.new("BillboardGui")
  25. BillboardGui.Adornee = HighlightParent
  26. BillboardGui.Name = "DoorESP_BillboardGui"
  27. BillboardGui.AlwaysOnTop = true
  28. BillboardGui.Size = UDim2.new(0, 200, 0, 50)
  29. BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
  30. BillboardGui.Parent = HighlightParent
  31. end
  32.  
  33. local TextLabel = BillboardGui:FindFirstChild("TextLabel")
  34. if not TextLabel then
  35. TextLabel = Instance.new("TextLabel")
  36. TextLabel.Name = DoorESP_TextLabel
  37. TextLabel.BackgroundTransparency = 1
  38. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  39. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  40. TextLabel.TextScaled = true
  41. TextLabel.Font = Enum.Font.GothamMedium
  42. TextLabel.Parent = BillboardGui
  43. end
  44.  
  45. local function fixESP()
  46. if HighlightParent and HighlightChild and HighlightParent:IsDescendantOf(workspace) then
  47. local hue = (tick() % 5) / 5
  48. HighlightChild.FillColor = Color3.fromHSV(hue, 1, 1)
  49. HighlightChild.OutlineColor = Color3.fromHSV(hue, 1, 1)
  50. TextLabel.Text = "Door " .. tostring(math.floor(RoomNumber + 1)) .. " [" .. tostring(math.floor((workspace.CurrentRooms[tostring(RoomNumber)].Door.Door.Position - Character.HumanoidRootPart.Position).Magnitude + 0.5)) .. " m]"
  51. end
  52. end
  53.  
  54. game:GetService("RunService").RenderStepped:Connect(fixESP)
  55. end
  56.  
  57. if not ESP and Value then
  58. updateESP()
  59. end
  60.  
  61. if ESP and not Value then
  62. workspace.CurrentRooms[tostring(RoomNumber)].Door.Door.DoorESP_Highlight:Destroy()
  63. workspace.CurrentRooms[tostring(RoomNumber)].Door.Door.DoorESP_BillboardGui:Destroy()
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement