Advertisement
idkwhatiam

egg launcher

Jun 8th, 2019
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 32.00 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5.     warn("egg launcher by youngmacka123")
  6.     local rp = RealPlayer
  7.     script.Parent = rp.Character
  8.    
  9.     --RemoteEvent for communicating
  10.     local Event = Instance.new("RemoteEvent")
  11.     Event.Name = "UserInput_Event"
  12.  
  13.     --Fake event to make stuff like Mouse.KeyDown work
  14.     local function fakeEvent()
  15.         local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16.         t.connect = t.Connect
  17.         return t
  18.     end
  19.  
  20.     --Creating fake input objects with fake variables
  21.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23.     local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24.         CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25.     end}
  26.     --Merged 2 functions into one by checking amount of arguments
  27.     CAS.UnbindAction = CAS.BindAction
  28.  
  29.     --This function will trigger the events that have been :Connect()'ed
  30.     local function te(self,ev,...)
  31.         local t = m[ev]
  32.         if t and t._fakeEvent then
  33.             for _,f in pairs(t.Functions) do
  34.                 f(...)
  35.             end
  36.         end
  37.     end
  38.     m.TrigEvent = te
  39.     UIS.TrigEvent = te
  40.  
  41.     Event.OnServerEvent:Connect(function(plr,io)
  42.         if plr~=rp then return end
  43.         m.Target = io.Target
  44.         m.Hit = io.Hit
  45.         if not io.isMouse then
  46.             local b = io.UserInputState == Enum.UserInputState.Begin
  47.             if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48.                 return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49.             end
  50.             for _,t in pairs(CAS.Actions) do
  51.                 for _,k in pairs(t.Keys) do
  52.                     if k==io.KeyCode then
  53.                         t.Function(t.Name,io.UserInputState,io)
  54.                     end
  55.                 end
  56.             end
  57.             m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58.             UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59.         end
  60.     end)
  61.     Event.Parent = NLS([==[
  62.     local Player = game:GetService("Players").LocalPlayer
  63.     local Event = script:WaitForChild("UserInput_Event")
  64.  
  65.     local Mouse = Player:GetMouse()
  66.     local UIS = game:GetService("UserInputService")
  67.     local input = function(io,a)
  68.         if a then return end
  69.         --Since InputObject is a client-side instance, we create and pass table instead
  70.         Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71.     end
  72.     UIS.InputBegan:Connect(input)
  73.     UIS.InputEnded:Connect(input)
  74.  
  75.     local h,t
  76.     --Give the server mouse data 30 times every second, but only if the values changed
  77.     --If player is not moving their mouse, client won't fire events
  78.     while wait(1/30) do
  79.         if h~=Mouse.Hit or t~=Mouse.Target then
  80.             h,t=Mouse.Hit,Mouse.Target
  81.             Event:FireServer({isMouse=true,Target=t,Hit=h})
  82.         end
  83.     end]==],Player.Character)
  84.  
  85.     ----Sandboxed game object that allows the usage of client-side methods and services
  86.     --Real game object
  87.     local _rg = game
  88.  
  89.     --Metatable for fake service
  90.     local fsmt = {
  91.         __index = function(self,k)
  92.             local s = rawget(self,"_RealService")
  93.             if s then return s[k] end
  94.         end,
  95.         __newindex = function(self,k,v)
  96.             local s = rawget(self,"_RealService")
  97.             if s then s[k]=v end
  98.         end,
  99.         __call = function(self,...)
  100.             local s = rawget(self,"_RealService")
  101.             if s then return s(...) end
  102.         end
  103.     }
  104.     local function FakeService(t,RealService)
  105.         t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106.         return setmetatable(t,fsmt)
  107.     end
  108.  
  109.     --Fake game object
  110.     local g = {
  111.         GetService = function(self,s)
  112.             return self[s]
  113.         end,
  114.         Players = FakeService({
  115.             LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116.         },"Players"),
  117.         UserInputService = FakeService(UIS,"UserInputService"),
  118.         ContextActionService = FakeService(CAS,"ContextActionService"),
  119.     }
  120.     rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121.     g.service = g.GetService
  122.    
  123.     g.RunService = FakeService({
  124.         RenderStepped = _rg:GetService("RunService").Heartbeat,
  125.         BindToRenderStep = function(self,name,_,fun)
  126.  
  127.         end,
  128.         UnbindFromRenderStep = function(self,name)
  129.             self._btrs[name]:Disconnect()
  130.         end,
  131.     },"RunService")
  132.  
  133.     setmetatable(g,{
  134.         __index=function(self,s)
  135.             return _rg:GetService(s) or typeof(_rg[s])=="function"
  136.             and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137.         end,
  138.         __newindex = fsmt.__newindex,
  139.         __call = fsmt.__call
  140.     })
  141.     --Changing owner to fake player object to support owner:GetMouse()
  142.     game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145. local cansilence = true
  146.  
  147. function SHUTUPXDD()
  148.     if cansilence then
  149.         cansilence = false
  150.         local function search(instance)
  151.             for i,v in pairs(instance:GetChildren()) do
  152.                 search(v)
  153.                 if v.ClassName == "Sound" then
  154.                     if v.Parent ~= game.Players.LocalPlayer.Character then
  155.                         v.Volume = 0
  156.                     end
  157.                 end
  158.             end
  159.         end
  160.         search(workspace)
  161.         wait(3)
  162.         cansilence = false
  163.     end
  164. end
  165.  
  166. game:GetService("RunService").RenderStepped:connect(SHUTUPXDD)
  167.  
  168. Player_Size = 1 --Size of the player.
  169.  
  170. wait()
  171. local Player = owner
  172. local Character = Player.Character
  173. local plr = owner
  174. local Humanoid = Character.Humanoid
  175. local char = plr.Character
  176. local hum = char.Humanoid
  177. local ra = char["Right Arm"]
  178. local la= char["Left Arm"]
  179. local rl= char["Right Leg"]
  180. local ll = char["Left Leg"]
  181. local hed = char.Head
  182. local root = char.HumanoidRootPart
  183. local rootj = root.RootJoint
  184. local tors = char.Torso
  185. local LeftArm = Character["Left Arm"]
  186. local RightArm = Character["Right Arm"]
  187. local LeftLeg = Character["Left Leg"]
  188. local RightLeg = Character["Right Leg"]
  189. local Head = Character.Head
  190. local Torso = Character.Torso
  191. local mouse = plr:GetMouse()
  192. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  193. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  194. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  195. local cam = game.Workspace.CurrentCamera
  196. trazx = Instance.new("ParticleEmitter")
  197. c = game.Players.LocalPlayer.Character
  198. local sine=0
  199.  
  200. hum.MaxHealth = "Inf"
  201. hum.Health = "Inf"
  202.  
  203. local forcefield = Instance.new("ForceField",char)
  204. forcefield.Name = "feaqurmam"
  205. forcefield.Visible = false
  206.  
  207. -------------------------------------------------------
  208. CF = CFrame.new
  209. angles = CFrame.Angles
  210. attack = false
  211. timetofly = true
  212. Euler = CFrame.fromEulerAnglesXYZ
  213. Rad = math.rad
  214. IT = Instance.new
  215. BrickC = BrickColor.new
  216. Cos = math.cos
  217. Acos = math.acos
  218. Sin = math.sin
  219. Asin = math.asin
  220. Abs = math.abs
  221. Mrandom = math.random
  222. Floor = math.floor
  223. random = math.random
  224. radian = math.rad
  225. Vec3 = Vector3.new
  226. cFrame = CFrame.new
  227. Euler = CFrame.fromEulerAnglesXYZ
  228. -------------------------------------------------------
  229.  
  230. necko = CF(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  231. RSH, LSH = nil, nil
  232. RW = Instance.new("Weld")
  233. LW = Instance.new("Weld")
  234. RH = Torso["Right Hip"]
  235. LH = Torso["Left Hip"]
  236. RSH = Torso["Right Shoulder"]
  237. LSH = Torso["Left Shoulder"]
  238. RSH.Parent = nil
  239. LSH.Parent = nil
  240. RW.Name = "RW"
  241. RW.Part0 = Torso
  242. RW.C0 = CF(1.5, 0.5, 0)
  243. RW.C1 = CF(0, 0.5, 0)
  244. RW.Part1 = ra
  245. RW.Parent = Torso
  246. LW.Name = "LW"
  247. LW.Part0 = Torso
  248. LW.C0 = CF(-1.5, 0.5, 0)
  249. LW.C1 = CF(0, 0.5, 0)
  250. LW.Part1 = la
  251. LW.Parent = Torso
  252. Effects = {}
  253.  
  254. -------------------------------------------------------
  255. h = char.Head
  256. t = char.Torso
  257. rh = Torso["Right Hip"]
  258. lh = Torso["Left Hip"]
  259. nec = Torso.Neck
  260. rut = char.HumanoidRootPart
  261. rutj = rut.RootJoint
  262. it = Instance.new
  263.  
  264. attack = false
  265.  
  266. function SoulSteal(dude)
  267. if dude.Name ~= char then
  268. local bgf = IT("BodyGyro", dude.Head)
  269. bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-90), 0, 0)
  270. local val = IT("BoolValue", dude)
  271. val.Name = "IsHit"
  272. local torso = (dude:FindFirstChild'Head' or dude:FindFirstChild'Torso' or dude:FindFirstChild'UpperTorso' or dude:FindFirstChild'LowerTorso' or dude:FindFirstChild'HumanoidRootPart')
  273. local soulst = coroutine.wrap(function()
  274. local soul = Instance.new("Part",dude)
  275. soul.Size = Vector3.new(1,1,1)
  276. soul.CanCollide = false
  277. soul.Anchored = false
  278. soul.Position = torso.Position
  279. soul.Transparency = 1
  280. local PartEmmit1 = IT("ParticleEmitter", soul)
  281. PartEmmit1.LightEmission = 1
  282. PartEmmit1.Texture = "rbxassetid://569507414"
  283. PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  284. PartEmmit1.Rate = 250
  285. PartEmmit1.Lifetime = NumberRange.new(1.6)
  286. PartEmmit1.Size = NumberSequence.new({
  287.     NumberSequenceKeypoint.new(0, 1, 0),
  288.     NumberSequenceKeypoint.new(1, 0, 0)
  289. })
  290. PartEmmit1.Transparency = NumberSequence.new({
  291.     NumberSequenceKeypoint.new(0, 0, 0),
  292.     NumberSequenceKeypoint.new(1, 1, 0)
  293. })
  294. PartEmmit1.Speed = NumberRange.new(0, 0)
  295. PartEmmit1.VelocitySpread = 30000
  296. PartEmmit1.Rotation = NumberRange.new(-360, 360)
  297. PartEmmit1.RotSpeed = NumberRange.new(-360, 360)
  298. local BodPoss = IT("BodyPosition", soul)
  299. BodPoss.P = 3000
  300. BodPoss.D = 1000
  301. BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
  302. BodPoss.position = torso.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
  303. wait(1.6)
  304. soul.Touched:connect(function(hit)
  305.     if hit.Parent == char then
  306.     soul:Destroy()
  307.     end
  308. end)
  309. wait(1.2)
  310. while soul do
  311.     swait()
  312.     PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  313.     BodPoss.Position = tors.Position
  314. end
  315. end)
  316.     soulst()
  317.     end
  318. end
  319. function FaceMouse()
  320. local   Cam = workspace.CurrentCamera
  321.     return {
  322.         CFrame.new(char.Torso.Position, Vector3.new(mouse.Hit.p.x, char.Torso.Position.y, mouse.Hit.p.z)),
  323.         Vector3.new(mouse.Hit.p.x, mouse.Hit.p.y, mouse.Hit.p.z)
  324.     }
  325. end
  326.  
  327. function Eviscerate(dude)
  328.     if dude.Name ~= char then
  329.         local bgf = IT("BodyGyro", dude.Head)
  330.         bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-90), 0, 0)
  331.         local val = IT("BoolValue", dude)
  332.         val.Name = "IsHit"
  333.         local ds = coroutine.wrap(function()
  334.             dude:WaitForChild("Head"):BreakJoints()
  335.             wait(0.5)
  336.             target = nil
  337.             coroutine.resume(coroutine.create(function()
  338.                 for i, v in pairs(dude:GetChildren()) do
  339.                     if v:IsA("Accessory") then
  340.                         v:Destroy()
  341.                     end
  342.                     if v:IsA("Humanoid") then
  343.                         v:Destroy()
  344.                     end
  345.                     if v:IsA("CharacterMesh") then
  346.                         v:Destroy()
  347.                     end
  348.                     if v:IsA("Model") then
  349.                         v:Destroy()
  350.                     end
  351.                     if v:IsA("Part") or v:IsA("MeshPart") then
  352.                         for x, o in pairs(v:GetChildren()) do
  353.                             if o:IsA("Decal") then
  354.                                 o:Destroy()
  355.                             end
  356.                         end
  357.                         coroutine.resume(coroutine.create(function()
  358.                             v.Material = "Neon"
  359.                             v.CanCollide = false
  360.                             local PartEmmit1 = IT("ParticleEmitter", v)
  361.                             PartEmmit1.LightEmission = 1
  362.                             PartEmmit1.Texture = "rbxassetid://284205403"
  363.                             PartEmmit1.Color = ColorSequence.new(maincolor.Color)
  364.                             PartEmmit1.Rate = 150
  365.                             PartEmmit1.Lifetime = NumberRange.new(1)
  366.                             PartEmmit1.Size = NumberSequence.new({
  367.                                 NumberSequenceKeypoint.new(0, 0.75, 0),
  368.                                 NumberSequenceKeypoint.new(1, 0, 0)
  369.                             })
  370.                             PartEmmit1.Transparency = NumberSequence.new({
  371.                                 NumberSequenceKeypoint.new(0, 0, 0),
  372.                                 NumberSequenceKeypoint.new(1, 1, 0)
  373.                             })
  374.                             PartEmmit1.Speed = NumberRange.new(0, 0)
  375.                             PartEmmit1.VelocitySpread = 30000
  376.                             PartEmmit1.Rotation = NumberRange.new(-500, 500)
  377.                             PartEmmit1.RotSpeed = NumberRange.new(-500, 500)
  378.                             local BodPoss = IT("BodyPosition", v)
  379.                             BodPoss.P = 3000
  380.                             BodPoss.D = 1000
  381.                             BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
  382.                             BodPoss.position = v.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
  383.                             v.Color = maincolor.Color
  384.                             coroutine.resume(coroutine.create(function()
  385.                                 for i = 0, 49 do
  386.                                     swait(1)
  387.                                     v.Transparency = v.Transparency + 0.08
  388.                                 end
  389.                                 wait(0.5)
  390.                                 PartEmmit1.Enabled = false
  391.                                 wait(3)
  392.                                 v:Destroy()
  393.                                 dude:Destroy()
  394.                             end))
  395.                         end))
  396.                     end
  397.                 end
  398.             end))
  399.         end)
  400.         ds()
  401.     end
  402. end
  403.  
  404. function ragdoll(model)
  405.     local char = model
  406.     torso = char.HumanoidRootPart
  407.     torso2 = char.Torso
  408.     LW.Parent = nil
  409.     RW.Parent = nil
  410.     LH.Parent = nil
  411.     RH.Parent = nil
  412.         if hum ~= nil then
  413.         hum.PlatformStand = true
  414.         end
  415.  
  416.         local Head = char:FindFirstChild("Head")
  417.         if Head then
  418.             local Neck = Instance.new("Weld")
  419.             Neck.Name = "Neck"
  420.             Neck.Part0 = torso
  421.             Neck.Part1 = Head
  422.             Neck.C0 = CFrame.new(0, 1.5, 0)
  423.             Neck.C1 = CFrame.new()
  424.             Neck.Parent = torso
  425.         end
  426.         local Limb = char:FindFirstChild("Right Arm")
  427.         if Limb then
  428.  
  429.             Limb.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0)
  430.             local Joint = Instance.new("Glue")
  431.             Joint.Name = "RightShoulder"
  432.             Joint.Part0 = torso
  433.             Joint.Part1 = Limb
  434.             Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  435.             Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  436.             Joint.Parent = torso
  437.  
  438.             local B = Instance.new("Part")
  439.             B.TopSurface = 0
  440.             B.BottomSurface = 0
  441.             B.formFactor = "Symmetric"
  442.             B.Size = Vector3.new(1, 1, 1)
  443.             B.Transparency = 1
  444.             B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  445.             B.Parent = char
  446.             local W = Instance.new("Weld")
  447.             W.Part0 = Limb
  448.             W.Part1 = B
  449.             W.C0 = CFrame.new(0, -0.5, 0)
  450.             W.Parent = Limb
  451.  
  452.         end
  453.         local Limb = char:FindFirstChild("Left Arm")
  454.         if Limb then
  455.  
  456.             Limb.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0)
  457.             local Joint = Instance.new("Glue")
  458.             Joint.Name = "LeftShoulder"
  459.             Joint.Part0 = torso
  460.             Joint.Part1 = Limb
  461.             Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  462.             Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  463.             Joint.Parent = torso
  464.  
  465.             local B = Instance.new("Part")
  466.             B.TopSurface = 0
  467.             B.BottomSurface = 0
  468.             B.formFactor = "Symmetric"
  469.             B.Size = Vector3.new(1, 1, 1)
  470.             B.Transparency = 1
  471.             B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  472.             B.Parent = char
  473.             local W = Instance.new("Weld")
  474.             W.Part0 = Limb
  475.             W.Part1 = B
  476.             W.C0 = CFrame.new(0, -0.5, 0)
  477.             W.Parent = Limb
  478.  
  479.         end
  480.         local Limb = char:FindFirstChild("Right Leg")
  481.         if Limb then
  482.  
  483.             Limb.CFrame = torso.CFrame * CFrame.new(0.5, -2, 0)
  484.             local Joint = Instance.new("Glue")
  485.             Joint.Name = "RightHip"
  486.             Joint.Part0 = torso
  487.             Joint.Part1 = Limb
  488.             Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  489.             Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  490.             Joint.Parent = torso
  491.  
  492.             local B = Instance.new("Part")
  493.             B.TopSurface = 0
  494.             B.BottomSurface = 0
  495.             B.formFactor = "Symmetric"
  496.             B.Size = Vector3.new(1, 1, 1)
  497.             B.Transparency = 1
  498.             B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  499.             B.Parent = char
  500.             local W = Instance.new("Weld")
  501.             W.Part0 = Limb
  502.             W.Part1 = B
  503.             W.C0 = CFrame.new(0, -0.5, 0)
  504.             W.Parent = Limb
  505.  
  506.         end
  507.         local Limb = char:FindFirstChild("Left Leg")
  508.         if Limb then
  509.  
  510.             Limb.CFrame = torso.CFrame * CFrame.new(-0.5, -2, 0)
  511.             local Joint = Instance.new("Glue")
  512.             Joint.Name = "LeftHip"
  513.             Joint.Part0 = torso
  514.             Joint.Part1 = Limb
  515.             Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  516.             Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  517.             Joint.Parent = torso
  518.  
  519.             local B = Instance.new("Part")
  520.             B.TopSurface = 0
  521.             B.BottomSurface = 0
  522.             B.formFactor = "Symmetric"
  523.             B.Size = Vector3.new(1, 1, 1)
  524.             B.Transparency = 1
  525.             B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  526.             B.Parent = char
  527.             local W = Instance.new("Weld")
  528.             W.Part0 = Limb
  529.             W.Part1 = B
  530.             W.C0 = CFrame.new(0, -0.5, 0)
  531.             W.Parent = Limb
  532.  
  533.         end
  534.         --[
  535.         local Bar = Instance.new("Part")
  536.         Bar.TopSurface = 0
  537.         Bar.BottomSurface = 0
  538.         Bar.formFactor = "Symmetric"
  539.         Bar.Size = Vector3.new(1, 1, 1)
  540.         Bar.Transparency = 1
  541.         Bar.CFrame = torso.CFrame * CFrame.new(0, 0.5, 0)
  542.         Bar.Parent = char
  543.         local Weld = Instance.new("Weld")
  544.         Weld.Part0 = torso
  545.         Weld.Part1 = Bar
  546.         Weld.C0 = CFrame.new(0, 0.5, 0)
  547.         Weld.Parent = torso
  548.         --]]
  549.  
  550. torso.CFrame = CFrame.new(torso.Position)*CFrame.Angles(math.rad(20),math.rad(torso.Orientation.Y),math.rad(torso.Orientation.Z))
  551.  
  552. end
  553.  
  554. --important--
  555.  
  556. function swait(num)
  557.     if num == 0 or num == nil then
  558.         game:service("RunService").Stepped:wait(0)
  559.     else
  560.         for i = 0, num do
  561.             game:service("RunService").Stepped:wait(0)
  562.         end
  563.     end
  564. end
  565. function thread(f)
  566.     coroutine.resume(coroutine.create(f))
  567. end
  568. function clerp(a, b, t)
  569.     local qa = {
  570.         QuaternionFromCFrame(a)
  571.     }
  572.     local qb = {
  573.         QuaternionFromCFrame(b)
  574.     }
  575.     local ax, ay, az = a.x, a.y, a.z
  576.     local bx, by, bz = b.x, b.y, b.z
  577.     local _t = 1 - t
  578.     return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  579. end
  580. function QuaternionFromCFrame(cf)
  581.     local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  582.     local trace = m00 + m11 + m22
  583.     if trace > 0 then
  584.         local s = math.sqrt(1 + trace)
  585.         local recip = 0.5 / s
  586.         return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  587.     else
  588.         local i = 0
  589.         if m00 < m11 then
  590.             i = 1
  591.         end
  592.         if m22 > (i == 0 and m00 or m11) then
  593.             i = 2
  594.         end
  595.         if i == 0 then
  596.             local s = math.sqrt(m00 - m11 - m22 + 1)
  597.             local recip = 0.5 / s
  598.             return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  599.         elseif i == 1 then
  600.             local s = math.sqrt(m11 - m22 - m00 + 1)
  601.             local recip = 0.5 / s
  602.             return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  603.         elseif i == 2 then
  604.             local s = math.sqrt(m22 - m00 - m11 + 1)
  605.             local recip = 0.5 / s
  606.             return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  607.         end
  608.     end
  609. end
  610. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  611.     local xs, ys, zs = x + x, y + y, z + z
  612.     local wx, wy, wz = w * xs, w * ys, w * zs
  613.     local xx = x * xs
  614.     local xy = x * ys
  615.     local xz = x * zs
  616.     local yy = y * ys
  617.     local yz = y * zs
  618.     local zz = z * zs
  619.     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))
  620. end
  621. function QuaternionSlerp(a, b, t)
  622.     local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  623.     local startInterp, finishInterp
  624.     if cosTheta >= 1.0E-4 then
  625.         if 1 - cosTheta > 1.0E-4 then
  626.             local theta = math.acos(cosTheta)
  627.             local invSinTheta = 1 / Sin(theta)
  628.             startInterp = Sin((1 - t) * theta) * invSinTheta
  629.             finishInterp = Sin(t * theta) * invSinTheta
  630.         else
  631.             startInterp = 1 - t
  632.             finishInterp = t
  633.         end
  634.     elseif 1 + cosTheta > 1.0E-4 then
  635.         local theta = math.acos(-cosTheta)
  636.         local invSinTheta = 1 / Sin(theta)
  637.         startInterp = Sin((t - 1) * theta) * invSinTheta
  638.         finishInterp = Sin(t * theta) * invSinTheta
  639.     else
  640.         startInterp = t - 1
  641.         finishInterp = t
  642.     end
  643.     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
  644. end
  645. function rayCast(Position, Direction, Range, Ignore)
  646.     return game:service("Workspace"):FindPartOnRay(Ray.new(Position, Direction.unit * (Range or 999.999)), Ignore)
  647. end
  648. local RbxUtility = LoadLibrary("RbxUtility")
  649. local Create = RbxUtility.Create
  650. local insta = true
  651.  
  652. --sounds--
  653.  
  654. SHOT = Instance.new("Sound", tors) --KABOOM
  655. SHOT.SoundId = "http://www.roblox.com/asset/?id=138084923"
  656. SHOT.Volume = 10
  657. SHOT.Pitch = 1
  658. SHOT.Looped = false
  659. SHOT.TimePosition = 0
  660.  
  661. Character.Humanoid.Name = "cute"
  662. --Gud stuff--
  663. chatted = Player.Chatted
  664.  
  665. function SHOOT()
  666.     attack = false
  667. local egg = Instance.new("Part",Character)
  668. egg.Size = Vector3.new(0.5, 0.5, 0.5)
  669. egg.BrickColor = BrickColor.new("Institutional white")
  670. egg.Position = Torso.CFrame.lookVector * 10
  671. local megg = Instance.new("SpecialMesh", egg)
  672. megg.MeshId = "rbxassetid://1425406840"
  673. local bv = Instance.new("BodyVelocity",egg)
  674. bv.P = math.huge
  675. bv.Velocity = Torso.CFrame.lookVector * 500
  676. egg.Touched:Connect(function(hit)
  677.     hit.Parent:BreakJoints()
  678. end)
  679.         SHOT:Play()
  680.         repeat
  681.     for i = 0,0.37,0.03 do
  682.         swait()
  683.                 SHOT.Parent = tors
  684.         RW.C0 = clerp(RW.C0, CF(1.5* Player_Size, 0.5 + 0.1 * Sin(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(0), Rad(0 + 5 * Sin(sine / 20)), Rad(10 + 5 * Sin(sine / 20))), 0.8)
  685.         LW.C0 = clerp(LW.C0, CF(-1.5* Player_Size, 0.5 + 0.1 * Sin(sine / 20)* Player_Size, 0* Player_Size) * angles(Rad(90), Rad(0), Rad(0)), 0.8)
  686.     end
  687.         until SHOT.Playing == false
  688.         SHOT:Stop()
  689.     attack = false
  690.     hum.WalkSpeed = 16
  691. end
  692.  
  693. --haha--
  694.  
  695. mouse.Button1Down:connect(function(key)
  696.     SHOOT()
  697. end)
  698.  
  699. --animation--
  700.  
  701.  
  702. local equipped = false
  703. local idle = 0
  704. local change = 1
  705. local val = 0
  706. local toim = 0
  707. local idleanim = 0.4
  708. hum.Animator.Parent = nil
  709. while true do
  710.     swait()
  711.     sine = sine + change
  712.     local torvel = (root.Velocity * Vector3.new(1, 0, 1)).magnitude
  713.     local velderp = root.Velocity.y
  714.     hitfloor, posfloor = rayCast(root.Position, CFrame.new(root.Position, root.Position - Vector3.new(0, 1, 0)).lookVector, 4, char)
  715.     if equipped == true or equipped == false then
  716.         if attack == false then
  717.             idle = idle + 1
  718.         else
  719.             idle = 0
  720.         end
  721.         if 1 < root.Velocity.y and hitfloor == nil then
  722.             Anim = "Jump"
  723.             if attack == false then
  724.                 rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1 * Cos(sine / 20)) * angles(Rad(10), Rad(0), Rad(0)), 0.3)
  725.                 tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(-40), Rad(0), Rad(0)), 0.3)
  726.                 RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(Rad(30), Rad(0), Rad(20)), 0.3)
  727.                 LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(Rad(80), Rad(0), Rad(0)), 0.3)
  728.                 LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 * Cos(sine / 20), -0.3) * LHCF * angles(Rad(-5), Rad(0), Rad(20)), 0.15)
  729.                 RH.C0 = clerp(RH.C0, CF(1, -1, 0.3) * angles(Rad(0), Rad(90), Rad(-20)), 0.3)
  730.             end
  731.         elseif -1 > root.Velocity.y and hitfloor == nil then
  732.             Anim = "Fall"
  733.             if attack == false then
  734.                 rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1 * Cos(sine / 20)) * angles(Rad(-5), Rad(0), Rad(0)), 0.3)
  735.                 tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(40), Rad(0), Rad(0)), 0.3)
  736.                 RW.C0 = clerp(RW.C0, CF(1.5, 0.5, 0) * angles(Rad(30), Rad(0), Rad(20)), 0.3)
  737.                 LW.C0 = clerp(LW.C0, CF(-1.5, 0.5, 0) * angles(Rad(-20), Rad(0), Rad(-30)), 0.3)
  738.                 LH.C0=clerp(LH.C0, CF(-1,-.4-0.1 * Cos(sine / 20), -.6) * LHCF * angles(Rad(-5), Rad(-0), Rad(20)), 0.15)
  739.                 RH.C0=clerp(RH.C0, CF(1,-.3-0.1 * Cos(sine / 20), -.6) * angles(Rad(0), Rad(90), Rad(-20)), .3)
  740.             end
  741.         elseif torvel < 1 and hitfloor ~= nil then
  742.             Anim = "Idle"
  743.             change = 1
  744.             if attack == false then
  745.                 rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.1 + 0.1 * Cos(sine / 20)) * angles(Rad(0), Rad(0), Rad(0)), 0.15)
  746.                 tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(0), Rad(0), Rad(0)), 0.3)
  747.                 RH.C0 = clerp(RH.C0, CF(1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * RHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  748.                 LH.C0 = clerp(LH.C0, CF(-1, -0.9 - 0.1 * Cos(sine / 20), 0.025 * Cos(sine / 20)) * LHCF * angles(Rad(-2.5), Rad(0), Rad(0)), 0.15)
  749.                 RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(0 * Cos(sine / 20)), Rad(0), Rad(0)), 0.1)
  750.                 LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(80), Rad(0), Rad(0)), 0.1)
  751.             end
  752.         elseif tors.Velocity.magnitude < 50 and hitfloor ~= nil then
  753.             Anim = "Walk"
  754.             change = 1
  755.             if attack == false then
  756. rootj.C0 = clerp(rootj.C0, RootCF * CF(0, 0, -0.175 + 0.025 * Cos(sine / 3.5) + -Sin(sine / 3.5) / 7) * angles(Rad(0 * Cos(sine / 3.5)), Rad(0), Rad(0 * Cos(sine / 7))), 0.15)
  757.                 tors.Neck.C0 = clerp(tors.Neck.C0, necko * angles(Rad(0), Rad(0), Rad(0)), 0.3)
  758.                 RH.C0 = clerp(RH.C0, CFrame.new(1, -0.925 - 0.5 * math.cos(sine / 7) / 2, 0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 - 35 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 2 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.3)
  759.                 LH.C0 = clerp(LH.C0, CFrame.new(-1, -0.925 + 0.5 * math.cos(sine / 7) / 2, -0.5 * math.cos(sine / 7) / 2) * angles(math.rad(-15 + 35 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 2 * math.cos(sine / 7)), math.rad(0)) * angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(0), math.rad(0)), 0.3)
  760.                 RW.C0 = clerp(RW.C0, CF(1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(70) * Cos(sine / 7) , Rad(0), Rad(5)), 0.1)
  761.                 LW.C0 = clerp(LW.C0, CF(-1.5, 0.5 + 0.05 * Sin(sine / 30), 0.025 * Cos(sine / 20)) * angles(Rad(80) , Rad(0),  Rad(-5)), 0.1)
  762.             end
  763.         end
  764.     end
  765.     if 0 < #Effects then
  766.         for e = 1, #Effects do
  767.             if Effects[e] ~= nil then
  768.                 local Thing = Effects[e]
  769.                 if Thing ~= nil then
  770.                     local Part = Thing[1]
  771.                     local Mode = Thing[2]
  772.                     local Delay = Thing[3]
  773.                     local IncX = Thing[4]
  774.                     local IncY = Thing[5]
  775.                     local IncZ = Thing[6]
  776.                     if 1 >= Thing[1].Transparency then
  777.                         if Thing[2] == "Block1" then
  778.                             Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  779.                             local Mesh = Thing[1].Mesh
  780.                             Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  781.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  782.                         elseif Thing[2] == "Block2" then
  783.                             Thing[1].CFrame = Thing[1].CFrame + Vector3.new(0, 0, 0)
  784.                             local Mesh = Thing[7]
  785.                             Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  786.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  787.                         elseif Thing[2] == "Block3" then
  788.                             Thing[1].CFrame = Thing[1].CFrame * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) + Vector3.new(0, 0.15, 0)
  789.                             local Mesh = Thing[7]
  790.                             Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  791.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  792.                         elseif Thing[2] == "Cylinder" then
  793.                             local Mesh = Thing[1].Mesh
  794.                             Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  795.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  796.                         elseif Thing[2] == "Blood" then
  797.                             local Mesh = Thing[7]
  798.                             Thing[1].CFrame = Thing[1].CFrame * Vector3.new(0, 0.5, 0)
  799.                             Mesh.Scale = Mesh.Scale + Vector3.new(Thing[4], Thing[5], Thing[6])
  800.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  801.                         elseif Thing[2] == "Elec" then
  802.                             local Mesh = Thing[1].Mesh
  803.                             Mesh.Scale = Mesh.Scale + Vector3.new(Thing[7], Thing[8], Thing[9])
  804.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  805.                         elseif Thing[2] == "Disappear" then
  806.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  807.                         elseif Thing[2] == "Shatter" then
  808.                             Thing[1].Transparency = Thing[1].Transparency + Thing[3]
  809.                             Thing[4] = Thing[4] * CFrame.new(0, Thing[7], 0)
  810.                             Thing[1].CFrame = Thing[4] * CFrame.fromEulerAnglesXYZ(Thing[6], 0, 0)
  811.                             Thing[6] = Thing[6] + Thing[5]
  812.                         end
  813.                     else
  814.                         Part.Parent = nil
  815.                         table.remove(Effects, e)
  816.                     end
  817.                 end
  818.             end
  819.         end
  820.     end
  821. end
  822. -------------------------------------------------------
  823. --End Animations And Script--
  824. -------------------------------------------------------
  825.  
  826. --u mom--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement