Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
do --CFrame lerp (stravant, clerp by AntiBoomz0r) local function QuaternionFromCFrame(cf) local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() local trace = m00 + m11 + m22 if trace > 0 then local s = math.sqrt(1 + trace) local recip = 0.5/s return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 else local i = 0 if m11 > m00 then i = 1 end if m22 > (i == 0 and m00 or m11) then i = 2 end if i == 0 then local s = math.sqrt(m00-m11-m22+1) local recip = 0.5/s return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip elseif i == 1 then local s = math.sqrt(m11-m22-m00+1) local recip = 0.5/s return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip elseif i == 2 then local s = math.sqrt(m22-m00-m11+1) local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip end end end local function QuaternionToCFrame(px, py, pz, x, y, z, w) local xs, ys, zs = x + x, y + y, z + z local wx, wy, wz = w*xs, w*ys, w*zs local xx = x*xs local xy = x*ys local xz = x*zs local yy = y*ys local yz = y*zs local zz = z*zs return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy)) end local function QuaternionSlerp(a, b, t) local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] local startInterp, finishInterp; if cosTheta >= 0.0001 then if (1 - cosTheta) > 0.0001 then local theta = math.acos(cosTheta) local invSinTheta = 1/math.sin(theta) startInterp = math.sin((1-t)*theta)*invSinTheta finishInterp = math.sin(t*theta)*invSinTheta else startInterp = 1-t finishInterp = t end else if (1+cosTheta) > 0.0001 then local theta = math.acos(-cosTheta) local invSinTheta = 1/math.sin(theta) startInterp = math.sin((t-1)*theta)*invSinTheta finishInterp = math.sin(t*theta)*invSinTheta else startInterp = t-1 finishInterp = t end end return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp end function clerp(a,b,t) local qa = {QuaternionFromCFrame(a)} local qb = {QuaternionFromCFrame(b)} local ax, ay, az = a.x, a.y, a.z local bx, by, bz = b.x, b.y, b.z local _t = 1-t return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) end end do --rayCast function rayCast(startpos, Speed, Gravity, Dmg) local ran,err = ypcall(function() local rayPart = Instance.new("Part", char) rayPart.Name = "RayPart" rayPart.BrickColor = BrickColor.new("Really red") rayPart.Anchored = true rayPart.Shape = Shape or "Ball" rayPart.CanCollide = false rayPart.Locked = true rayPart.TopSurface = Enum.SurfaceType.Smooth rayPart.BottomSurface = Enum.SurfaceType.Smooth rayPart.Size = Vector3.new(.2, 2, .2) local msh = Instance.new("SpecialMesh",rayPart) msh.MeshId = "http://www.roblox.com/asset/?id=16190555" msh.TextureId = "http://www.roblox.com/asset/?id=16190577" msh.Scale = Vector3.new(2, 2, 2) local bulletposition = startpos.Position rayPart.CFrame = startpos.CFrame local bulletvelocity = (Vector3.new(math.random(-2,2), math.random(-2,2), math.random(-2,2)))+( mouse.Hit.p - bulletposition).unit*Speed local bulletlastposition = bulletposition coroutine.resume(coroutine.create(function() while true do local dt = wait() bulletlastposition = bulletposition bulletvelocity = bulletvelocity + (Vector3.new(0, -3.81*Gravity, 0)*dt) bulletposition = bulletposition + (bulletvelocity*dt) local ray = Ray.new(bulletlastposition, (bulletposition - bulletlastposition)) local hit, hitposition = workspace:FindPartOnRayWithIgnoreList( ray, { char, rayPart, camera} ) if (torso.Position - rayPart.Position).magnitude > 540 then rayPart:Destroy() break end if hit then local damage = math.random(Dmg, Dmg+6) if hit.Parent:findFirstChild("Humanoid") ~= nil then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - damage elseif hit.Parent:IsA("Hat") and hit.Parent.Parent:findFirstChild("Humanoid") then hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health - damage end bulletposition = hitposition rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0) for i = 1, 50 do local s = Instance.new("Part") s.CanCollide = false s.Shape = 1 s.Locked = true s.formFactor = "Custom" pl = Instance.new("PointLight", s) pl.Range = 8 pl.Color = Color3.new(0.8, 0.8, 0) s.Size = Vector3.new(.3,.3,.3) s.Transparency = 0.5 s.BrickColor = BrickColor.new("Brick yellow") local v = Vector3.new(math.random(-1,1), math.random(1,2), math.random(-1,1)) s.Velocity = 0.5 * v s.CFrame = CFrame.new(rayPart.Position + v, v) s.Parent = workspace coroutine.resume(coroutine.create(function() wait(2) s:Destroy() end)) end rayPart:Destroy() break end rayPart.CFrame = CFrame.new(bulletposition, bulletposition+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0) rayPart.Parent = workspace end end)) end) if not ran and err then print(err) end end end do --the animating plr = game:service'Players'.LocalPlayer char = plr.Character mouse = plr:GetMouse() humanoid = char:findFirstChild("Humanoid") torso = char:findFirstChild("Torso") head = char.Head ra = char:findFirstChild("Right Arm") la = char:findFirstChild("Left Arm") rl = char:findFirstChild("Right Leg") ll = char:findFirstChild("Left Leg") rs = torso:findFirstChild("Right Shoulder") ls = torso:findFirstChild("Left Shoulder") rh = torso:findFirstChild("Right Hip") lh = torso:findFirstChild("Left Hip") neck = torso:findFirstChild("Neck") rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint") anim = char:findFirstChild("Animate") rootpart = char:findFirstChild("HumanoidRootPart") camera = workspace.CurrentCamera local rm = Instance.new("Weld", torso) rm.C0 = CFrame.new(1.5, 0.5, 0) rm.C1 = CFrame.new(0, 0.5, 0) rm.Part0 = torso rm.Part1 = ra local lm = Instance.new("Weld", torso) lm.C0 = CFrame.new(-1.5, 0.5, 0) lm.C1 = CFrame.new(0, 0.5, 0) lm.Part0 = torso lm.Part1 = la local speed = 0.3 local angle = 0 local anglespeed = 1 rsc0 = rm.C0 lsc0 = lm.C0 rjc0 = rj.C0 neckc0 = neck.C0 radian = math.rad apple = Instance.new("Part", char) apple.FormFactor = "Custom" apple.Size = Vector3.new(1, 1, 1) apple:breakJoints() local wld = Instance.new("Weld", char) wld.C1 = CFrame.new(0, -1, 0) wld.C0 = CFrame.Angles(math.pi, 0, 0) wld.Part1 = ra wld.Part0 = apple local msh = Instance.new("SpecialMesh", apple) msh.MeshId = "http://www.roblox.com/asset/?id=16190555" msh.TextureId = "http://www.roblox.com/asset/?id=16190577" msh.Scale = Vector3.new(2, 2, 2) mouse.Button1Down:connect(function() if throwing then return end throwing = true wait(wait()*8) for trans = 1, 0, -0.1 do apple.Transparency = trans wait() end end) done = false while wait() do angle = (angle % 100) + anglespeed/10 mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10)) local rscf = rsc0 local lscf = lsc0 local rjcf = rjc0 local ncf = neckc0 lscf = lsc0 * CFrame.Angles(-radian(5), 0, -radian(5)) if throwing then for waiting = 0, 250, 30 do if done then return end rscf = rsc0 * CFrame.Angles(radian(waiting), 0, 0) rm.C0 = clerp(rm.C0,rscf,speed) wait() if waiting == 250 then done = true end end rscf = rsc0 * CFrame.Angles(radian(120), 0, 0) rayCast(apple, math.random(140, 150), 20, 28) throwing = false done = false end rm.C0 = clerp(rm.C0,rscf,speed) lm.C0 = clerp(lm.C0,lscf,speed) rj.C0 = clerp(rj.C0,rjcf,speed) neck.C0 = clerp(neck.C0,ncf,speed) end end
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
1 hour ago | 12.49 KB
Untitled
3 hours ago | 12.40 KB
programacion_algoritmos_flashcards.tsv
5 hours ago | 2.67 KB
Untitled
5 hours ago | 17.13 KB
Untitled
7 hours ago | 18.40 KB
Untitled
9 hours ago | 17.70 KB
Untitled
11 hours ago | 16.97 KB
Untitled
13 hours ago | 21.75 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!