Advertisement
Elvisfofo_rblx

Laser Eyes Script

Jun 22nd, 2025
1,666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local UserInputService = game:GetService("UserInputService")
  3. local RunService = game:GetService("RunService")
  4. local Debris = game:GetService("Debris")
  5.  
  6. local LocalPlayer = Players.LocalPlayer
  7. local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  8. local Mouse = LocalPlayer:GetMouse()
  9.  
  10. -- Get eye position
  11. local function getEyePos()
  12. local head = Character:FindFirstChild("Head")
  13. if not head then return nil end
  14.  
  15. if Character:FindFirstChild("Humanoid") and Character:FindFirstChild("Humanoid").RigType == Enum.HumanoidRigType.R15 then
  16. return head.Position + Vector3.new(0.2, 0.3, 0) -- Offset for R15 eyes
  17. else
  18. return head.Position + Vector3.new(0.25, 0.25, 0) -- Offset for R6 eyes
  19. end
  20. end
  21.  
  22. -- Fire one laser beam
  23. local function fireLaser(targetPos)
  24. local origin = getEyePos()
  25. if not origin then return end
  26.  
  27. local laser = Instance.new("Part")
  28. laser.Anchored = true
  29. laser.CanCollide = false
  30. laser.Material = Enum.Material.Neon
  31. laser.BrickColor = BrickColor.new("Really red")
  32. laser.Size = Vector3.new(0.2, 0.2, (origin - targetPos).Magnitude)
  33. laser.CFrame = CFrame.new(origin, targetPos) * CFrame.new(0, 0, -laser.Size.Z / 2)
  34. laser.Parent = workspace
  35.  
  36. Debris:AddItem(laser, 0.1)
  37.  
  38. -- Raycast to damage
  39. local rayParams = RaycastParams.new()
  40. rayParams.FilterDescendantsInstances = {Character}
  41. rayParams.FilterType = Enum.RaycastFilterType.Blacklist
  42. local result = workspace:Raycast(origin, (targetPos - origin).Unit * 100, rayParams)
  43.  
  44. if result and result.Instance then
  45. local target = result.Instance:FindFirstAncestorOfClass("Model")
  46. if target and target:FindFirstChild("Humanoid") and target ~= Character then
  47. target.Humanoid:TakeDamage(10)
  48. end
  49. end
  50. end
  51.  
  52. -- Hold to laser loop
  53. local firing = false
  54. local stopLaser = false
  55.  
  56. local function startLaser()
  57. if firing then return end
  58. firing = true
  59. while firing and not stopLaser do
  60. local targetPos = Mouse.Hit.Position
  61. fireLaser(targetPos)
  62. task.wait(0.1)
  63. end
  64. end
  65.  
  66. local function stopLaserFunc()
  67. stopLaser = true
  68. firing = false
  69. task.wait(0.2)
  70. stopLaser = false
  71. end
  72.  
  73. -- Mobile Tap & Hold Input
  74. UserInputService.TouchStarted:Connect(function()
  75. startLaser()
  76. end)
  77.  
  78. UserInputService.TouchEnded:Connect(function()
  79. stopLaserFunc()
  80. end)
  81.  
  82. -- Optional notification
  83. pcall(function()
  84. game.StarterGui:SetCore("SendNotification", {
  85. Title = "🔴 Laser Eyes Ready",
  86. Text = "Tap & hold to shoot from your eyes!",
  87. Duration = 5
  88. })
  89. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement