Guest User

Untitled

a guest
Apr 9th, 2025
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. script.Parent.shot.OnServerEvent:Connect(function(player, mp2)
  2. local MaxDistance = math.huge -- Maximum distance the ray can go
  3. script.Parent.Handle.pow:Play()
  4. script.Parent.Handle.Flare.ParticleEmitter:Emit(100)
  5.  
  6. local dist = (script.Parent.Handle.Flare.WorldPosition - mp2)
  7. local raycastparams = RaycastParams.new()
  8. local direction = (mp2 - script.Parent.Handle.Flare.WorldPosition).Unit * 999999999999999999
  9. local direction2 = (mp2 - script.Parent.Handle.Flare.WorldPosition).Unit
  10. raycastparams.FilterDescendantsInstances = script.Parent.Parent:GetDescendants()
  11. raycastparams.FilterType = Enum.RaycastFilterType.Blacklist
  12.  
  13. local raycast = workspace:Raycast(script.Parent.Handle.Flare.WorldPosition, direction, raycastparams)
  14. local part = Instance.new("Part", script.Parent)
  15. part.Anchored = true
  16. game.Debris:AddItem(part, .02)
  17. part.CanCollide = false
  18. part.CanTouch = false
  19. part.CanQuery = false
  20. part.Size = Vector3.new(.001, .001, .001)
  21. part.Transparency = 1
  22. local att = Instance.new("Attachment", part)
  23.  
  24. if raycast then
  25. if raycast.Instance.Parent:FindFirstChildOfClass("Humanoid") then
  26. raycast.Instance.Parent:FindFirstChildOfClass("Humanoid").Health -= math.random(10, 15)
  27. end
  28. part.Position = raycast.Position
  29. script.Parent.Handle.Beam.Attachment1 = att
  30. else
  31. part.Position = script.Parent.Handle.Flare.WorldPosition + direction2 * 2000
  32. script.Parent.Handle.Beam.Attachment1 = att
  33. end
  34. end)
Add Comment
Please, Sign In to add comment