Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Lightning(from,to,times,offset,col,thickness,tra)
- local magz = (from - to).magnitude
- local curpos = from
- local trz = {-offset,offset}
- for i=1,times do
- 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"
- local ofz = v3(trz[mran(1,2)],trz[mran(1,2)],trz[mran(1,2)])
- local trolpos = cn(curpos,to)cn(0,0,magz/times).p+ofz
- if times == i then
- local magz2 = (curpos - to).magnitude
- li.Size = v3(thickness,thickness,magz2)
- li.CFrame = cn(curpos,to)cn(0,0,-magz2/2)
- else
- li.CFrame = cn(curpos,trolpos)cn(0,0,magz/times/2)
- end
- curpos = li.CFramecn(0,0,magz/times/2).p
- deb:AddItem(li,0.25)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement