Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------
- --[[ The Coffe Rage Script edit ]]--
- -------------------------------
- --[[
- Created by LegendOfDarknees.
- and also leaked by LegendOfDarknees.
- Note:
- I decided to leak it cause this
- pathetic skid "pxire" leeched it out
- of my friend. If you see "pxire",
- never trade him or let your friends
- be friends with him.
- Anyway, pxire claims that he made this.
- Too bad I leaked it first
- Anyway, so you script kiddies enjoy this.
- By the way, this script is old, so I don't really care about it.
- Do not remove this credit.
- Edited by GMAEKILLERTOY
- --]]
- local p=game:service("Players").LocalPlayer
- -------------------------------
- local p=game:service("Players").LocalPlayer
- if p.Name=="Reruderu" then
- p:Kick("go away, skid who uses crappy decompilers,v3rmie skid.")
- elseif p.Name=="Rerumu" then
- p:Kick("no thanks, skid who uses crappy decompilers that they didnt make.also being an pathetic v3rmie kid")
- end
- local char=p.Character
- script.Parent=char
- local torso=char.Torso
- local hed=char.Head
- local larm=char:FindFirstChild("Left Arm")
- local rarm=char:FindFirstChild("Right Arm")
- local lleg=char:FindFirstChild("Left Leg")
- local rleg=char:FindFirstChild("Right Leg")
- local hum=char.Humanoid
- local cam=workspace.CurrentCamera
- local root=char.HumanoidRootPart
- local mouse=p:GetMouse()
- local hb=game:service("RunService").Heartbeat
- local rs=game:service("RunService").Stepped
- hum.MaxHealth=10000000
- hum.Health=hum.MaxHealth
- local pgui=Instance.new("ScreenGui",p.PlayerGui)
- random={25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-36,-37,-38,-39,-40,-41,-42,-43,-44,-45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56,-57,-58,-59,-60,-61,-62,-63,-64,-65,-66,-67,-68,-69,-70,-71,-72,-73,-74,-75,-76,-77,-78,-79,-80,-81,-82,-83,-84,-85,-86,-87,-88,-89,-90,-91,-92,-93,-94,-95,-96,-97,-98,-99,-100}
- local run = 60
- local JumpPower = 10000
- local normal = 16
- local color = "Really black"
- -------------------
- local drinks="10722059"
- local m="10470609"
- local tx="278162610"
- local ragesong="142312526"
- local breaks="257422322"
- local scream="527276541"
- -------------------
- function fnt(pos,dist,splr)
- if splr then return(splr.Torso.CFrame.p -pos).magnitude < dist end
- local list = {}
- for i,v in pairs(workspace:GetChildren())do
- if v:IsA("Model")then
- if v:findFirstChild("Torso")then
- if v ~= char then
- if(v.Torso.Position -pos).magnitude <= dist then
- table.insert(list,v)
- end
- end
- end
- end
- end
- return list
- end
- function fnp(pos,dist,splr)
- if splr then return(splr.Torso.CFrame.p -pos).magnitude < dist end
- local list = {}
- for i,v in pairs(workspace:GetChildren())do
- if v:IsA("Part")then
- if v ~= char and v.Name~="Car" and v~=torso and v.Name~="Base" and v.Name~="Baseplate" then
- if(v.Position -pos).magnitude <= dist then
- table.insert(list,v)
- end
- end
- end
- end
- return list
- end
- fw = function(wp0, wp1, wc0x, wc0y, wc0z) -- fast weld
- local wld = Instance.new("Weld", wp1)
- wld.Part0 = wp0
- wld.Part1 = wp1
- wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
- end
- local trans=false
- ------------------------------------
- local s0=Instance.new("Sound",char)
- s0.SoundId="rbxassetid://"..ragesong
- s0.Volume=1
- s0.Pitch=1
- s0.Looped=true
- local hair = Instance.new("Part",char)
- hair.Material="Neon"
- hair.CanCollide=false
- hair.Size=Vector3.new(0.1,0.1,0.1)
- hair.BrickColor=BrickColor.Random()
- hair.Transparency=0
- local msh = Instance.new("SpecialMesh",hair)
- msh.MeshId="rbxassetid://212348733"
- msh.Scale=Vector3.new(1.05, 1.2, 1)
- local w = Instance.new("Weld",hair)
- w.Part1=hair
- w.Part0=hed
- w.C0=CFrame.new(.1,.1,0)
- ----------chat
- p.Chatted:connect(function(m)
- say(string.sub(m, 1, string.len(m)),0,3)
- end)
- ------------------------------------
- anim="idle"
- local sine=0
- local add=0
- local value=0
- local ffing=false
- local msgs=0
- attack=false
- NoAnims=false
- ----preparing character----
- fw(torso, larm, -1.5, 0.5, 0)
- larm.Weld.C1 = CFrame.new(0, 0.5, 0)
- fw(torso, rarm, 1.5, 0.5, 0)
- rarm.Weld.C1 = CFrame.new(0, 0.5, 0)
- fw(torso, hed, 0, 1.5, 0)
- fw(torso, lleg, -0.5, -1, 0)
- lleg.Weld.C1 = CFrame.new(0, 1, 0)
- fw(torso, rleg, 0.5, -1, 0)
- rleg.Weld.C1 = CFrame.new(0, 1, 0)
- fw(root, torso, 0, -1, 0)
- torso.Weld.C1 = CFrame.new(0, -1, 0)
- --------------rot------------
- local r=0
- local radd=0.04
- coroutine.wrap(function()
- while rs:wait() do
- r=r+radd
- end
- end)()
- attack = false
- -----------------------------
- local e = Instance.new("Part",char)
- e.Name="Mug"
- e.CanCollide=false
- e.Size=Vector3.new(1,1,1)
- local me=Instance.new("SpecialMesh",e)
- me.MeshId="rbxassetid://"..m
- me.TextureId="rbxassetid://"..tx
- me.Scale=Vector3.new(1.2, 1.2, 1.2)
- local w=Instance.new("Weld",e)
- w.Part1=e
- w.Part0=larm
- w.C0=CFrame.new(0,-1.35,0)*CFrame.Angles(math.rad(-90),0,0)
- -----------------------------
- mouse.KeyDown:connect(function(key)
- if key == "f" and attack == false then
- if trans == false then
- attack = true
- NoAnims = true
- for i = 1, 30 do
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,-1,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(0),0,0),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5,-0.5)*CFrame.Angles(math.rad(0),0,0),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- hb:wait()
- end
- NoAnims=false
- attack=false
- end
- end
- end)
- mouse.KeyDown:connect(function(key)
- if key == "e" and attack == false then
- if trans == false then
- attack=true
- NoAnims=true
- hum.WalkSpeed=0
- local fx = Instance.new("Sound",char)
- fx.SoundId="rbxassetid://"..drinks
- fx.Volume=10
- fx.Pitch=1
- fx:Play()
- for i = 1, 30 do
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,-1,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(0),0,0.15),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(0),0,-0.15),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(0)+-math.sin(sine/14)/7,0,-6+-math.sin(sine/14)/7),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5,-0.5)*CFrame.Angles(math.rad(140),0,-5.4),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- rs:wait()
- end
- wait(3)
- w:Destroy()
- e.CanCollide=true
- fx.SoundId="rbxassetid://"..breaks
- fx:Play()
- e.Touched:connect(function()
- local cf=e.CFrame
- e:Destroy()
- for i = 1, 10 do
- local g = Instance.new("WedgePart",char)
- g.Name="spike"
- g.CFrame=cf
- g.BrickColor=BrickColor.new("Bright blue")
- g.Reflectance=0.3
- g.Transparency=0.4
- g.Size=Vector3.new(0.1,0.1,0.1)
- wait()
- end
- end)
- for i = 1, 30 do
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,-1,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(0),0,0.15),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(0),0,-0.15),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(0)+-math.sin(sine/14)/7,0,-6+-math.sin(sine/14)/7),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5,-0.5)*CFrame.Angles(math.rad(140),0,-5.4),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,-0.4)*CFrame.Angles(math.rad(-40),0,0),0.25)
- rs:wait()
- end
- print("drinked")
- local fx2 = Instance.new("Sound",char)
- fx2.SoundId="rbxassetid://"..scream
- fx2.Volume=1000
- fx2.Pitch=1
- fx2:Play()
- coroutine.wrap(function()
- while trans == false do
- wait(0.2)
- local ef = Instance.new("Part",char)
- ef.Name="pulse"
- ef.BrickColor=BrickColor.Random()
- ef.Material="Neon"
- ef.Shape="Ball"
- ef.CanCollide=false
- ef.Anchored=true
- ef.Size=Vector3.new(1,1,1)
- ef.CFrame=torso.CFrame
- local ef2 = ef:Clone()
- ef2.Parent=ef
- ef2.BrickColor=BrickColor.Random()
- ef2.Name="call"
- ef2.Size=Vector3.new(1,1,1)
- local em=Instance.new("SpecialMesh",ef2)
- em.MeshId="rbxassetid://3270017"
- em.Scale=Vector3.new(1,1,0.0001)
- local ef3 = ef2:Clone()
- ef3.Parent=ef
- ef3.Name="aura"
- ef3.CFrame=root.CFrame
- local em2=ef3.Mesh
- em2.MeshId="rbxassetid://20329976"
- em2.Scale=Vector3.new(1,0.4,1)
- local ef4 = ef3:Clone()
- ef4.Parent=ef
- local em3=ef4.Mesh
- local ef5 = ef2:Clone()
- ef5.Parent=ef
- local em4=ef5.Mesh
- coroutine.wrap(function()
- for i = 1, 60 do
- rs:wait()
- ef.Size=ef.Size+Vector3.new(1,1,1)
- ef.Transparency=ef.Transparency+1/60
- ef2.Size=ef2.Size+Vector3.new(1,0.3,1)
- ef2.Transparency=ef2.Transparency+1/60
- em.Scale=em.Scale+Vector3.new(1,1,0)
- ef2.CFrame=torso.CFrame*CFrame.Angles(r,r,r)
- ef3.Size=ef3.Size+Vector3.new(1,0.3,1)
- ef3.Transparency=ef3.Transparency+1/60
- ef3.CFrame=root.CFrame*CFrame.Angles(0,r,0)
- em2.Scale=em2.Scale+Vector3.new(1,0.3,1)
- ef4.Size=ef4.Size+Vector3.new(1,0.3,1)
- ef4.Transparency=ef4.Transparency+1/60
- ef4.CFrame=root.CFrame*CFrame.Angles(0,-r,0)
- em3.Scale=em3.Scale+Vector3.new(1,0.3,1)
- ef5.Transparency=ef5.Transparency+1/60
- em4.Scale=em4.Scale+Vector3.new(1,1,0)
- ef5.CFrame=torso.CFrame*CFrame.Angles(-r,-r,-r)
- end
- ef:Destroy()
- ef2:Destroy()
- ef3:Destroy()
- ef4:Destroy()
- ef5:Destroy()
- end)()
- end
- local ef = Instance.new("Part",char)
- ef.Name="pulse"
- ef.BrickColor=BrickColor.Random()
- ef.Material="Neon"
- ef.Shape="Ball"
- ef.CanCollide=false
- ef.Anchored=true
- ef.Size=Vector3.new(1,1,1)
- ef.CFrame=root.CFrame
- local em=Instance.new("SpecialMesh",ef)
- em.MeshId="rbxassetid://9982590"
- em.Scale=Vector3.new(1,0.3,1)
- local ef2 = ef:Clone()
- ef2.Parent=ef
- ef2.Name="aura"
- ef2.CFrame=root.CFrame
- ef2.Mesh:Destroy()
- local ef3 = ef:Clone()
- ef3.Parent=ef
- ef3.Name="aura"
- ef3.CFrame=root.CFrame
- ef3.Mesh:Destroy()
- local em2=Instance.new("SpecialMesh",ef3)
- em2.MeshId="rbxassetid://20329976"
- em2.Scale=Vector3.new(1,0.3,1)
- coroutine.wrap(function()
- for i = 1, 160 do
- ef.Size=ef.Size+Vector3.new(2,2,2)
- ef.Transparency=ef.Transparency+1/160
- em.Scale=em.Scale+Vector3.new(0.6,0.6,0.6)
- ef.CFrame=root.CFrame*CFrame.Angles(r,r,r)
- ef3.Transparency=ef3.Transparency+1/160
- ef3.CFrame=root.CFrame*CFrame.Angles(0,r,0)
- em2.Scale=em2.Scale+Vector3.new(2,0.8,2)
- ef2.Size=ef2.Size+Vector3.new(2,2,2)
- ef2.Transparency=ef2.Transparency+1/160
- rs:wait()
- end
- ef:Destroy()
- ef2:Destroy()
- ef3:Destroy()
- end)()
- end)()
- for i = 1, 30 do
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,4,0)*CFrame.Angles(math.rad(20),0,0),0.25)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0.2)*CFrame.Angles(math.rad(-40),0,0.15),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0.2)*CFrame.Angles(math.rad(-40),0,-0.15),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.5,0.2)*CFrame.Angles(math.rad(-40),0,-6),0.25)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5,0.2)*CFrame.Angles(math.rad(-40),0,6),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- rs:wait()
- end
- wait(8.7)
- s0:Play()
- trans=true
- print("Transformed")
- hair.Transparency=0
- for i,v in pairs(char:GetChildren()) do
- if v:FindFirstChild("Handle") then
- v.Handle.Transparency=0
- end
- end
- hum.WalkSpeed=normal
- NoAnims=false
- attack=false
- end
- end
- end)
- ------effects------
- coroutine.wrap(function()
- while wait(0.05) do
- if trans == true then
- local ef = Instance.new("Part",char)
- ef.Name="effect"
- ef.CanCollide=false
- ef.Anchored=true
- ef.CFrame=root.CFrame*CFrame.new(0,-2.5,0)*CFrame.Angles(0,r,0)
- ef.Size=Vector3.new(1,1,1)
- ef.BrickColor=BrickColor.Random()
- ef.Material="Neon"
- local em = Instance.new("SpecialMesh",ef)
- em.MeshId="rbxassetid://20329976"
- em.Scale=Vector3.new(1,0.2,1)
- coroutine.wrap(function()
- for i = 1, 30 do
- ef.Size=ef.Size:lerp(ef.Size+Vector3.new(0.035,0.035,0.035),0.25)
- em.Scale=em.Scale:lerp(em.Scale+Vector3.new(1,0.3,1),0.25)
- ef.Transparency=ef.Transparency+1/30
- rs:wait()
- end
- ef:Destroy()
- end)()
- end
- end
- end)()
- coroutine.wrap(function()
- while wait(0.05) do
- if trans == true then
- local ef = Instance.new("Part",char)
- ef.Name="effect"
- ef.CanCollide=false
- ef.Anchored=true
- ef.CFrame=torso.CFrame*CFrame.new(0,0,0)*CFrame.Angles(r,r,r)
- ef.Size=Vector3.new(1,1,1)
- ef.BrickColor=BrickColor.Random()
- ef.Material="Neon"
- local em = Instance.new("SpecialMesh",ef)
- em.MeshId="rbxassetid://3270017"
- em.Scale=Vector3.new(1,1,0.00000001)
- coroutine.wrap(function()
- for i = 1, 30 do
- ef.Size=ef.Size:lerp(ef.Size+Vector3.new(0.035,0.035,0),0.25)
- em.Scale=em.Scale:lerp(em.Scale+Vector3.new(1.2,1.2,0),0.25)
- ef.Transparency=ef.Transparency+1/30
- rs:wait()
- end
- ef:Destroy()
- end)()
- end
- end
- end)()
- coroutine.wrap(function()
- while wait(0.1) do
- if trans == true then
- local ef = Instance.new("Part",char)
- ef.Name="effect"
- ef.CanCollide=false
- ef.Anchored=true
- ef.CFrame=lleg.CFrame*CFrame.new(0,-1.05,0)*CFrame.Angles(r,r,r)
- ef.Size=Vector3.new(1,1,1)
- ef.BrickColor=BrickColor.Random()
- ef.Material="Neon"
- coroutine.wrap(function()
- for i = 1, 30 do
- ef.Size=ef.Size:lerp(ef.Size+Vector3.new(0.035,0.035,0.035),0.25)
- ef.Transparency=ef.Transparency+1/30
- rs:wait()
- end
- ef:Destroy()
- end)()
- local ef2 = Instance.new("Part",char)
- ef2.Name="effect"
- ef2.CanCollide=false
- ef2.Anchored=true
- ef2.CFrame=rleg.CFrame*CFrame.new(0,-1.05,0)*CFrame.Angles(r,r,r)
- ef2.Size=Vector3.new(1,1,1)
- ef2.BrickColor=BrickColor.Random()
- ef2.Material="Neon"
- coroutine.wrap(function()
- for i = 1, 30 do
- ef2.Size=ef2.Size:lerp(ef2.Size+Vector3.new(0.035,0.035,0.035),0.25)
- ef2.Transparency=ef2.Transparency+1/30
- rs:wait()
- end
- ef2:Destroy()
- end)()
- end
- end
- end)()
- coroutine.wrap(function()
- while wait(0.1) do
- if trans == true then
- local ef = Instance.new("Part",char)
- ef.Name="effect"
- ef.CanCollide=false
- ef.Anchored=true
- ef.CFrame=larm.CFrame*CFrame.new(0,-1.05,0)*CFrame.Angles(r,r,r)
- ef.Size=Vector3.new(1,1,1)
- ef.BrickColor=BrickColor.Random()
- ef.Material="Neon"
- coroutine.wrap(function()
- for i = 1, 30 do
- ef.Size=ef.Size:lerp(ef.Size+Vector3.new(0.05,0.05,0.05),0.25)
- ef.Transparency=ef.Transparency+1/30
- rs:wait()
- end
- ef:Destroy()
- end)()
- local ef2 = Instance.new("Part",char)
- ef2.Name="effect"
- ef2.CanCollide=false
- ef2.Anchored=true
- ef2.CFrame=rarm.CFrame*CFrame.new(0,-1.05,0)*CFrame.Angles(r,r,r)
- ef2.Size=Vector3.new(1,1,1)
- ef2.BrickColor=BrickColor.Random()
- ef2.Material="Neon"
- coroutine.wrap(function()
- for i = 1, 30 do
- ef2.Size=ef2.Size:lerp(ef2.Size+Vector3.new(0.05,0.05,0.05),0.25)
- ef2.Transparency=ef2.Transparency+1/30
- rs:wait()
- end
- ef2:Destroy()
- end)()
- end
- end
- end)()
- hum.MaxHealth=150000
- hum.Health=hum.MaxHealth
- shirt = Instance.new("Shirt",game.Players.LocalPlayer.Character)
- shirt.ShirtTemplate = "rbxassetid://512329769"
- pants = Instance.new("Pants",game.Players.LocalPlayer.Character)
- pants.PantsTemplate = "rbxassetid://200745302"
- -----animations-----
- mouse.KeyDown:connect(function(key)
- if key=="0" then
- char.Humanoid.WalkSpeed = run
- hed.Velocity=hed.CFrame.lookVector*100
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key=="0" then
- char.Humanoid.WalkSpeed = normal
- end
- end)
- game:GetService("RunService").RenderStepped:connect(function()
- char.Humanoid.FreeFalling:connect(function(f)
- if f then
- ffing = true
- else
- ffing = false
- end
- end)
- sine = sine + add
- if ffing==true then
- anim="jump"
- elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 2 then
- anim="idle"
- elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 20 then
- anim = "walk"
- elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude > 20 then
- anim = "run"
- end
- if NoAnims==false then
- if anim=="idle" then
- add=0.5
- if trans == false then
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,-1,0)*CFrame.Angles(math.rad(0),0,0),0.05)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(0),0,0.15),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(0),0,-0.15),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(0)+-math.sin(sine/14)/7,0,-6+-math.sin(sine/14)/7),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(90)+-math.sin(sine/14)/7,0,0),0.1)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(0),0,0),0.25)
- else
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,0+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(0),0,0),0.05)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(0),0,0.15+math.sin(sine/14)/20),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(0),0,-0.15+-math.sin(sine/14)/20),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-10)+-math.sin(sine/14)/7,0,-6+-math.sin(sine/14)/7),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-10)+-math.sin(sine/14)/7,0,6+math.sin(sine/14)/7),0.1)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,-0.15)*CFrame.Angles(math.rad(-20),0,0),0.25)
- end
- elseif anim=="walk" then
- add=0.5
- if trans == false then
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,-1+math.sin(sine/3.5)/3,0)*CFrame.Angles(math.rad(-10),0,0),0.25)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1+math.sin(sine/7)/2,-0.15+-math.sin(sine/7)/2)*CFrame.Angles(math.rad(-20)+math.sin(sine/7)/2,0,0.05),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1+-math.sin(sine/7)/2,-0.15+math.sin(sine/7)/2)*CFrame.Angles(math.rad(-20)+-math.sin(sine/7)/2,0,-0.05),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.5+-math.cos(sine/7)/7,0+math.sin(sine/14)/7)*CFrame.Angles(math.rad(0)+-math.sin(sine/14)/2,0,-6+-math.sin(sine/14)/7),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5+-math.cos(sine/10)/14,0)*CFrame.Angles(math.rad(90)+-math.sin(sine/14)/7,0,0),0.1)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(10),0,0),0.25)
- else
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,0+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-10),0,0),0.05)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(-10),0,0.15+math.sin(sine/14)/20),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(-10),0,-0.15+-math.sin(sine/14)/20),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-20)+-math.sin(sine/14)/7,0,-6+-math.sin(sine/14)/7),0.1)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.6+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-20)+-math.sin(sine/14)/7,0,6+math.sin(sine/14)/7),0.1)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,-0.15)*CFrame.Angles(math.rad(-20),0,0),0.25)
- end
- elseif anim=="run" then
- add=0.5
- if trans == false then
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,-1+math.sin(sine/2)/3,0)*CFrame.Angles(math.rad(-37),0,0),0.025)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1+math.sin(sine/4)/2,-0.15+-math.sin(sine/4)/2)*CFrame.Angles(math.rad(-20)+math.sin(sine/4)/2,0,0.05),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1+-math.sin(sine/4)/2,-0.15+math.sin(sine/4)/2)*CFrame.Angles(math.rad(-20)+-math.sin(sine/4)/2,0,-0.05),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.5,0.1)*CFrame.Angles(math.rad(-20)+-math.sin(sine/17)/7,0,-6),0.25)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5,0.1)*CFrame.Angles(math.rad(-20)+-math.sin(sine/17)/7,0,6),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0)*CFrame.Angles(math.rad(20),0,0),0.25)
- else
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0,1+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-70),0,0),0.25)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-1,0)*CFrame.Angles(math.rad(0),0,0.15),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0)*CFrame.Angles(math.rad(0),0,-0.15),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.5+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-20)+-math.sin(sine/14)/7,0,-6),0.25)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5+-math.cos(sine/14)/7,0)*CFrame.Angles(math.rad(-20)+-math.sin(sine/14)/7,0,6),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,0.3)*CFrame.Angles(math.rad(70),0,0),0.25)
- end
- elseif anim=="jump" then
- add=0.5
- torso.Weld.C0=torso.Weld.C0:lerp(CFrame.new(0+-math.cos(sine/14)/7,.5+-math.cos(sine/14)/7,0+-math.cos(sine/14)/7)*CFrame.Angles(math.rad(0),0,0),0.05)
- rleg.Weld.C0=rleg.Weld.C0:lerp(CFrame.new(.5,-0.7,-0.5)*CFrame.Angles(math.rad(10),0,0),0.25)
- lleg.Weld.C0=lleg.Weld.C0:lerp(CFrame.new(-.5,-1,0.1)*CFrame.Angles(math.rad(-10),0,0),0.25)
- rarm.Weld.C0=rarm.Weld.C0:lerp(CFrame.new(1.5,0.5,0)*CFrame.Angles(math.rad(50),0,90),0.25)
- larm.Weld.C0=larm.Weld.C0:lerp(CFrame.new(-1.5,0.5,0)*CFrame.Angles(math.rad(50),0,-90),0.25)
- hed.Weld.C0=hed.Weld.C0:lerp(CFrame.new(0,1.5,-0.1)*CFrame.Angles(math.rad(-20),0,0),0.25)
- end
- end
- end)
- local verlet = {}
- verlet.step_time = 1 / 50
- verlet.gravity = Vector3.new(0, -10, 0)
- local char = game.Players.LocalPlayer.Character
- local torso = char:WaitForChild("Torso")
- local parts = {}
- local render = game:GetService("RunService").RenderStepped
- wait(2)
- local point = {}
- local link = {}
- local rope = {}
- local function ccw(A,B,C)
- return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)
- end
- local function intersect(A,B,C,D)
- return ccw(A,C,D) ~= ccw(B,C,D) and ccw(A,B,C) ~= ccw(A,B,D)
- end
- local function vec2(v)
- return Vector2.new(v.x, v.z)
- end
- function point:step()
- if not self.fixed then
- local derivative = (self.position - self.last_position) * 0.95
- self.last_position = self.position
- self.position = self.position + derivative + (self.velocity * verlet.step_time ^ 2)
- --[[local torsoP = torso.CFrame * CFrame.new(-1, 0, 0.5)
- local torsoE = torso.CFrame * CFrame.new(1, 0, 0.5)
- local pointE = self.position + torso.CFrame.lookVector * 100
- local doIntersect = intersect(vec2(torsoP.p), vec2(torsoE.p), vec2(self.position), vec2(pointE))
- if not doIntersect then
- self.postition = self.position - torso.CFrame.lookVector * 10
- end]]
- end
- end
- function link:step()
- for i = 1, 1 do
- local distance = self.point1.position - self.point2.position
- local magnitude = distance.magnitude
- local differance = (self.length - magnitude) / magnitude
- local translation = ((self.point1.fixed or self.point2.fixed) and 1 or 0.6) * distance * differance
- if not self.point1.fixed then
- self.point1.position = self.point1.position + translation
- end
- if not self.point2.fixed then
- self.point2.position = self.point2.position - translation
- end
- end
- end
- function verlet.new(class, a, b, c)
- if class == "Point" then
- local new = {}
- setmetatable(new, {__index = point})
- new.class = class
- new.position = a or Vector3.new()
- new.last_position = new.position
- new.velocity = verlet.gravity
- new.fixed = false
- return new
- elseif class == "Link" then
- local new = {}
- setmetatable(new, {__index = link})
- new.class = class
- new.point1 = a
- new.point2 = b
- new.length = c or (a.position - b.position).magnitude
- return new
- elseif class == "Rope" then
- local new = {}
- setmetatable(new, {__index = link})
- new.class = class
- new.start_point = a
- new.finish_point = b
- new.points = {}
- new.links = {}
- local inc = (b - a) / 10
- for i = 0, 10 do
- table.insert(new.points, verlet.new("Point", a + (i * inc)))
- end
- for i = 2, #new.points do
- table.insert(new.links, verlet.new("Link", new.points[i - 1], new.points[i]))
- end
- return new
- end
- end
- local tris = {}
- local triParts = {}
- local function GetDiscoColor(hue)
- local section = hue % 1 * 3
- local secondary = 0.5 * math.pi * (section % 1)
- if section < 1 then
- return Color3.new(1, 1 - math.cos(secondary), 1 - math.sin(secondary))
- elseif section < 2 then
- return Color3.new(1 - math.sin(secondary), 1, 1 - math.cos(secondary))
- else
- return Color3.new(1 - math.cos(secondary), 1 - math.sin(secondary), 1)
- end
- end
- local function setupPart(part)
- part.Anchored = true
- part.FormFactor = 3
- part.CanCollide = false
- part.TopSurface = 10
- part.BottomSurface = 10
- part.LeftSurface = 10
- part.RightSurface = 10
- part.FrontSurface = 10
- part.BackSurface = 10
- part.Material = "Neon"
- local m = Instance.new("SpecialMesh", part)
- m.MeshType = "Wedge"
- m.Scale = Vector3.new(0.2, 1, 1)
- return part
- end
- local function CFrameFromTopBack(at, top, back)
- local right = top:Cross(back)
- return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
- end
- local function drawTri(parent, a, b, c)
- local this = {}
- local mPart1 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
- local mPart2 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
- function this:Set(a, b, c)
- local ab, bc, ca = b-a, c-b, a-c
- local abm, bcm, cam = ab.magnitude, bc.magnitude, ca.magnitude
- local edg1 = math.abs(0.5 + ca:Dot(ab)/(abm*abm))
- local edg2 = math.abs(0.5 + ab:Dot(bc)/(bcm*bcm))
- local edg3 = math.abs(0.5 + bc:Dot(ca)/(cam*cam))
- if edg1 < edg2 then
- if edg1 >= edg3 then
- a, b, c = c, a, b
- ab, bc, ca = ca, ab, bc
- abm = cam
- end
- else
- if edg2 < edg3 then
- a, b, c = b, c, a
- ab, bc, ca = bc, ca, ab
- abm = bcm
- else
- a, b, c = c, a, b
- ab, bc, ca = ca, ab, bc
- abm = cam
- end
- end
- local len1 = -ca:Dot(ab)/abm
- local len2 = abm - len1
- local width = (ca + ab.unit*len1).magnitude
- local maincf = CFrameFromTopBack(a, ab:Cross(bc).unit, -ab.unit)
- if len1 > 0.2 then
- mPart1.Parent = parent
- mPart1.Size = Vector3.new(0.2, width, len1)
- mPart1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
- else
- mPart1.Parent = nil
- end
- if len2 > 0.2 then
- mPart2.Parent = parent
- mPart2.Size = Vector3.new(0.2, width, len2)
- mPart2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
- else
- mPart2.Parent = nil
- end
- end
- function this:SetProperty(prop, value)
- mPart1[prop] = value
- mPart2[prop] = value
- end
- this:Set(a, b, c)
- function this:Destroy()
- mPart1:Destroy()
- mPart2:Destroy()
- end
- this.p1 = mPart1
- this.p2 = mPart2
- this.p1.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p1.CFrame.Y * 0.5 + time())))
- this.p2.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p2.CFrame.Y * 0.5 + time())))
- return this
- end
- function verlet.draw(object, id)
- if object.class == "Point" then
- local part = parts[id]
- part.BrickColor = BrickColor.new(1, 1, 1)
- part.Transparency = 0
- part.formFactor = 3
- part.Anchored = true
- part.CanCollide = false
- part.TopSurface = 0
- part.BottomSurface = 0
- part.Size = Vector3.new(0.35, 0.35, 0.35)
- part.Material = "Neon"
- part.CFrame = CFrame.new(object.position)
- part.Parent = torso
- return part
- elseif object.class == "Link" then
- local part = parts[id]
- local dist = (object.point1.position - object.point2.position).magnitude
- part.Size = Vector3.new(0.2, 0.2, dist)
- part.CFrame = CFrame.new(object.point1.position, object.point2.position) * CFrame.new(0, 0, dist * -0.5)
- part.Parent = torso
- return part
- end
- end
- function verlet.clear()
- for _, v in pairs(workspace:GetChildren()) do
- if v.Name == "Part" then
- v:Destroy()
- end
- end
- end
- local points = {}
- local links = {}
- for x = 0, 2 do
- points[x] = {}
- for y = 0, 3 do
- points[x][y] = verlet.new("Point", torso.Position + Vector3.new(x * 0.8 - 2, 2 - y * 0.8, 5 + y * 0.4))
- points[x][y].fixed = y == 0
- end
- end
- for x = 1, 2 do
- for y = 0, 3 do
- links[#links + 1] = verlet.new("Link", points[x][y], points[x - 1][y], 1 + y * 0.08)
- end
- end
- for x = 0, 2 do
- for y = 1, 3 do
- links[#links + 1] = verlet.new("Link", points[x][y], points[x][y - 1], 1.2 + y * 0.03)
- end
- end
- render:connect(function()
- for x = 0, 2 do
- for y = 0, 3 do
- if y == 0 then
- points[x][y].position = (torso.CFrame * CFrame.new(x * 1 - 1, 1, 0.5)).p
- else
- points[x][y]:step()
- end
- end
- end
- for i = 1, #links do
- links[i]:step()
- end
- for i = 1, #tris do
- triParts[#triParts + 1] = tris[i].p1
- triParts[#triParts + 1] = tris[i].p2
- end
- tris = {}
- for x = 1, 2 do
- for y = 1, 3 do
- tris[#tris + 1] = drawTri(torso, points[x - 1][y - 1].position, points[x - 1][y].position, points[x][y - 1].position)
- tris[#tris + 1] = drawTri(torso, points[x][y].position, points[x - 1][y].position, points[x][y - 1].position)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement