Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to create and manage the Billboard GUI above a player's head
- local function createBillboardAboveHead(player)
- -- Check if the player exists and has a character
- if player and player.Character then
- local character = player.Character
- local head = character:FindFirstChild("Head")
- -- Ensure the player has a head
- if head then
- -- Create Billboard GUI
- local billboard = Instance.new("BillboardGui")
- billboard.Name = "Entity404Billboard"
- billboard.Size = UDim2.new(0, 200, 0, 50) -- Set size of the billboard
- billboard.AlwaysOnTop = true -- Ensure it is always on top of other GUI elements
- billboard.StudsOffset = Vector3.new(0, 2.5, 0) -- Offset closer to head position
- -- Create TextLabel for the text
- local textLabel = Instance.new("TextLabel")
- textLabel.Parent = billboard
- textLabel.Size = UDim2.new(1, 0, 1, 0) -- Full size of the billboard
- textLabel.Text = "Entity404"
- textLabel.TextColor3 = Color3.fromRGB(128, 0, 0) -- Maroon color
- textLabel.BackgroundTransparency = 1 -- Make background transparent
- textLabel.Font = Enum.Font.SourceSansBold -- Set font
- textLabel.TextScaled = true -- Scale text based on size
- -- Attach Billboard GUI to Head
- billboard.Parent = head
- -- Function to update Billboard GUI visibility based on camera distance
- local function updateVisibility()
- local camera = game.Workspace.CurrentCamera
- if camera then
- local headPosition = head.Position + billboard.StudsOffset
- local distance = (headPosition - camera.CFrame.Position).Magnitude
- if distance > 50 then
- billboard.Enabled = true
- else
- billboard.Enabled = false
- end
- end
- end
- -- Call updateVisibility initially and connect to RenderStepped for continuous update
- updateVisibility()
- game:GetService("RunService").RenderStepped:Connect(updateVisibility)
- -- Function to create an oval part launched forward from the player
- local function launchOval()
- local oval = Instance.new("Part")
- oval.Size = Vector3.new(4, 1, 2) -- Set size of the oval
- oval.Shape = Enum.PartType.Cylinder -- Change shape to cylinder (which looks oval)
- oval.Color = Color3.fromRGB(100, 0, 0) -- Dark red color
- oval.Material = Enum.Material.Neon -- Neon material
- oval.Position = head.Position + head.CFrame.LookVector * 3 -- Position in front of the head
- oval.Velocity = head.CFrame.LookVector * 100 -- Launch velocity in head direction (adjust speed as needed)
- oval.Parent = game.Workspace -- Set parent to Workspace
- -- Collision detection and filtering
- local debounce = false
- oval.Touched:Connect(function(hit)
- if not debounce and hit.Parent and hit.Parent:IsA("Model") and hit.Parent:FindFirstChildOfClass("Humanoid") then
- local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
- if humanoid and humanoid.Parent ~= character then
- debounce = true
- humanoid.Health = 0 -- Kill the player
- wait(1) -- Prevent immediate collision re-trigger
- debounce = false
- end
- end
- end)
- -- Destroy oval after some time to clean up
- wait(3)
- oval:Destroy()
- end
- -- Create a frame in the UI (StarterGui) with a text button for instructions
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 50)
- frame.Position = UDim2.new(0.02, 0, 0.02, 0)
- frame.BackgroundTransparency = 1
- frame.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("StarterGui") -- Assuming StarterGui exists
- local textButton = Instance.new("TextButton")
- textButton.Size = UDim2.new(1, 0, 1, 0)
- textButton.Text = "Z to summon kill ovals"
- textButton.TextColor3 = Color3.new(1, 1, 1)
- textButton.Font = Enum.Font.SourceSansBold
- textButton.TextScaled = true
- textButton.Parent = frame
- -- Connect launchOval function to "Z" key press
- game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
- if input.KeyCode == Enum.KeyCode.Z and not gameProcessed then
- launchOval()
- end
- end)
- end
- end
- end
- -- Call createBillboardAboveHead for the specific player who triggers it
- local player = game.Players.LocalPlayer -- Replace with the player you want to trigger the effects for
- createBillboardAboveHead(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement