Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function Lightning(from,to,times,offset,col,thickness,tra)
  2. local magz = (from - to).magnitude
  3. local curpos = from
  4. local trz = {-offset,offset}
  5. for i=1,times do
  6. local li = iPart{workspace,thickness,thickness,magz/times,an=true,tr=tra or 0.4,co=col or "New Yeller"} li.CanCollide = false li.Name = "unray"
  7. local ofz = v3(trz[mran(1,2)],trz[mran(1,2)],trz[mran(1,2)])
  8. local trolpos = cn(curpos,to)cn(0,0,magz/times).p+ofz
  9. if times == i then
  10. local magz2 = (curpos - to).magnitude
  11. li.Size = v3(thickness,thickness,magz2)
  12. li.CFrame = cn(curpos,to)cn(0,0,-magz2/2)
  13. else
  14. li.CFrame = cn(curpos,trolpos)cn(0,0,magz/times/2)
  15. end
  16. curpos = li.CFramecn(0,0,magz/times/2).p
  17. deb:AddItem(li,0.25)
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement