Advertisement
lllkkklkk

ENTITY 404 V1

Jul 27th, 2024
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. -- Function to create and manage the Billboard GUI above a player's head
  2. local function createBillboardAboveHead(player)
  3. -- Check if the player exists and has a character
  4. if player and player.Character then
  5. local character = player.Character
  6. local head = character:FindFirstChild("Head")
  7.  
  8. -- Ensure the player has a head
  9. if head then
  10. -- Create Billboard GUI
  11. local billboard = Instance.new("BillboardGui")
  12. billboard.Name = "Entity404Billboard"
  13. billboard.Size = UDim2.new(0, 200, 0, 50) -- Set size of the billboard
  14. billboard.AlwaysOnTop = true -- Ensure it is always on top of other GUI elements
  15. billboard.StudsOffset = Vector3.new(0, 2.5, 0) -- Offset closer to head position
  16.  
  17. -- Create TextLabel for the text
  18. local textLabel = Instance.new("TextLabel")
  19. textLabel.Parent = billboard
  20. textLabel.Size = UDim2.new(1, 0, 1, 0) -- Full size of the billboard
  21. textLabel.Text = "Entity404"
  22. textLabel.TextColor3 = Color3.fromRGB(128, 0, 0) -- Maroon color
  23. textLabel.BackgroundTransparency = 1 -- Make background transparent
  24. textLabel.Font = Enum.Font.SourceSansBold -- Set font
  25. textLabel.TextScaled = true -- Scale text based on size
  26.  
  27. -- Attach Billboard GUI to Head
  28. billboard.Parent = head
  29.  
  30. -- Function to update Billboard GUI visibility based on camera distance
  31. local function updateVisibility()
  32. local camera = game.Workspace.CurrentCamera
  33. if camera then
  34. local headPosition = head.Position + billboard.StudsOffset
  35. local distance = (headPosition - camera.CFrame.Position).Magnitude
  36. if distance > 50 then
  37. billboard.Enabled = true
  38. else
  39. billboard.Enabled = false
  40. end
  41. end
  42. end
  43.  
  44. -- Call updateVisibility initially and connect to RenderStepped for continuous update
  45. updateVisibility()
  46. game:GetService("RunService").RenderStepped:Connect(updateVisibility)
  47.  
  48. -- Function to create an oval part launched forward from the player
  49. local function launchOval()
  50. local oval = Instance.new("Part")
  51. oval.Size = Vector3.new(4, 1, 2) -- Set size of the oval
  52. oval.Shape = Enum.PartType.Cylinder -- Change shape to cylinder (which looks oval)
  53. oval.Color = Color3.fromRGB(100, 0, 0) -- Dark red color
  54. oval.Material = Enum.Material.Neon -- Neon material
  55. oval.Position = head.Position + head.CFrame.LookVector * 3 -- Position in front of the head
  56. oval.Velocity = head.CFrame.LookVector * 100 -- Launch velocity in head direction (adjust speed as needed)
  57. oval.Parent = game.Workspace -- Set parent to Workspace
  58.  
  59. -- Collision detection and filtering
  60. local debounce = false
  61. oval.Touched:Connect(function(hit)
  62. if not debounce and hit.Parent and hit.Parent:IsA("Model") and hit.Parent:FindFirstChildOfClass("Humanoid") then
  63. local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
  64. if humanoid and humanoid.Parent ~= character then
  65. debounce = true
  66. humanoid.Health = 0 -- Kill the player
  67. wait(1) -- Prevent immediate collision re-trigger
  68. debounce = false
  69. end
  70. end
  71. end)
  72.  
  73. -- Destroy oval after some time to clean up
  74. wait(3)
  75. oval:Destroy()
  76. end
  77.  
  78. -- Create a frame in the UI (StarterGui) with a text button for instructions
  79. local frame = Instance.new("Frame")
  80. frame.Size = UDim2.new(0, 200, 0, 50)
  81. frame.Position = UDim2.new(0.02, 0, 0.02, 0)
  82. frame.BackgroundTransparency = 1
  83. frame.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("StarterGui") -- Assuming StarterGui exists
  84.  
  85. local textButton = Instance.new("TextButton")
  86. textButton.Size = UDim2.new(1, 0, 1, 0)
  87. textButton.Text = "Z to summon kill ovals"
  88. textButton.TextColor3 = Color3.new(1, 1, 1)
  89. textButton.Font = Enum.Font.SourceSansBold
  90. textButton.TextScaled = true
  91. textButton.Parent = frame
  92.  
  93. -- Connect launchOval function to "Z" key press
  94. game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
  95. if input.KeyCode == Enum.KeyCode.Z and not gameProcessed then
  96. launchOval()
  97. end
  98. end)
  99. end
  100. end
  101. end
  102.  
  103. -- Call createBillboardAboveHead for the specific player who triggers it
  104. local player = game.Players.LocalPlayer -- Replace with the player you want to trigger the effects for
  105. createBillboardAboveHead(player)
  106.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement