Advertisement
KrYn0MoRe

crystal pvp [old]

Jun 23rd, 2020 (edited)
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 40.36 KB | None | 0 0
  1. --//=================================\\
  2. --|| SAZERENOS' ARTIFICIAL HEARTBEAT
  3. --\\=================================//
  4.  
  5. ArtificialHB = Instance.new("BindableEvent", script)
  6. ArtificialHB.Name = "ArtificialHB"
  7.  
  8. script:WaitForChild("ArtificialHB")
  9.  
  10. frame = (1/60)
  11. tf = 0
  12. allowframeloss = false
  13. tossremainder = false
  14. lastframe = tick()
  15. script.ArtificialHB:Fire()
  16.  
  17. game:GetService("RunService").Heartbeat:connect(function(s, p)
  18.     tf = tf + s
  19.     if tf >= frame then
  20.         if allowframeloss then
  21.             script.ArtificialHB:Fire()
  22.             lastframe = tick()
  23.         else
  24.             for i = 1, math.floor(tf / frame) do
  25.                 script.ArtificialHB:Fire()
  26.             end
  27.         lastframe = tick()
  28.         end
  29.         if tossremainder then
  30.             tf = 0
  31.         else
  32.             tf = tf - frame * math.floor(tf / frame)
  33.         end
  34.     end
  35. end)
  36.  
  37. function Swait(NUMBER)
  38.     if NUMBER == 0 or NUMBER == nil then
  39.         ArtificialHB.Event:wait()
  40.     else
  41.         for i = 1, NUMBER do
  42.             ArtificialHB.Event:wait()
  43.         end
  44.     end
  45. end
  46.  
  47. --//=================================\\
  48. --\\=================================//
  49.  
  50. local lfx = false
  51. local crystals = {}
  52. local sine = 0
  53. local base_speed = 0.025;
  54. local speed1,speed2,speed3 = base_speed/2,base_speed/3,base_speed/1.5;
  55. spawn(function()
  56.     game:GetService("RunService").Stepped:Connect(function()
  57.         sine = sine+2;
  58.         for i,v in ipairs(crystals) do
  59.             local p1,p2,p3 = v.p1,v.p2,v.p3
  60.             p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(0,speed2,speed2);
  61.             p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(0,speed1,speed1);
  62.             p3.CFrame = p3.CFrame*CFrame.fromEulerAnglesXYZ(speed3,speed3,0);
  63.             p1.Position = p1.Position+Vector3.new(0,0.12*math.cos(sine/24),0);
  64.             p2.Position = p2.Position+Vector3.new(0,0.12*math.cos(sine/24),0);
  65.             p3.Position = p3.Position+Vector3.new(0,0.12*math.cos(sine/24),0);
  66.         end
  67.     end)
  68. end)
  69. function spawn_crystal()
  70. local plr = owner;
  71. local char = plr.Character;
  72. local hum = char:FindFirstChildOfClass("Humanoid");
  73. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart");
  74.  
  75. local partfolder = Instance.new("Folder");
  76. partfolder.Parent = script;
  77. partfolder.Name = 'partfolder';
  78.  
  79. local debris = game:GetService("Debris");
  80. local tween = game:GetService("TweenService");
  81.  
  82. local explosionstimepos = {0,4,8,12,16};
  83. local maintimepos = 1;
  84. local used = 0
  85.  
  86. local function createcrystal(pos)
  87.     local Model0 = Instance.new("Model");
  88.     local Part1 = Instance.new("Part");
  89.     local Part4 = Instance.new("Part");
  90.     local Part6 = Instance.new("Part");
  91.     local Part69 = Instance.new("Part");
  92.     Model0.Name = "End Crystal";
  93.     Model0.Parent = partfolder;
  94.     Part1.Name = "Outside";
  95.     Part1.Parent = Model0;
  96.     Part1.Orientation = Vector3.new(0, 45, 0);
  97.     Part1.Position = pos+Vector3.new(0,0.5,0);
  98.     Part1.Rotation = Vector3.new(0, 45, 0);
  99.     Part1.Color = Color3.new(0.666667, 0, 0.666667);
  100.     Part1.Material = Enum.Material.Fabric;
  101.     Part1.Transparency = 1;
  102.     Part1.Size = Vector3.new(3.5, 3.5, 3.5);
  103.     Part1.Anchored = true;
  104.     Part1.BottomSurface = Enum.SurfaceType.Smooth;
  105.     Part1.BrickColor = BrickColor.new("Magenta");
  106.     Part1.CanCollide = false;
  107.     Part1.TopSurface = Enum.SurfaceType.Smooth;
  108.     Part1.brickColor = BrickColor.new("Magenta");
  109.     Part69.Name = "HumanoidRootPart";
  110.     Part69.Parent = Model0;
  111.     Part69.Orientation = Vector3.new(0, 45, 0);
  112.     Part69.Position = pos-Vector3.new(0,4.3,0);
  113.     Part69.Rotation = Vector3.new(0, 45, 0);
  114.     Part69.Material = Enum.Material.Concrete;
  115.     Part69.Color = Color3.new(0, 0, 0);
  116.     Part69.Transparency = 1;
  117.     Part69.Size = Vector3.new(0.05, 0.5, 0.05);
  118.     Part69.Anchored = true;
  119.     Part69.CanCollide = false;
  120.     Part4.Name = "Torso";
  121.     Part4.Parent = Model0;
  122.     Part4.Orientation = Vector3.new(45, 0, 0);
  123.     Part4.Position = pos+Vector3.new(0,0.5,0);
  124.     Part4.Rotation = Vector3.new(45, 0, 0);
  125.     Part4.Color = Color3.new(0.666667, 0, 0.666667);
  126.     Part4.Material = Enum.Material.Fabric;
  127.     Part4.Transparency = 1;
  128.     Part4.Size = Vector3.new(3.2, 3.2, 3.2);
  129.     Part4.Anchored = true;
  130.     Part4.BottomSurface = Enum.SurfaceType.Smooth;
  131.     Part4.BrickColor = BrickColor.new("Magenta");
  132.     Part4.CanCollide = false;
  133.     Part4.TopSurface = Enum.SurfaceType.Smooth;
  134.     Part4.brickColor = BrickColor.new("Magenta");
  135.     Part6.Name = "Head";
  136.     Part6.Parent = Model0;
  137.     Part6.Orientation = Vector3.new(45, 0, 0);
  138.     Part6.Position = pos+Vector3.new(0,0.5,0);
  139.     Part6.Rotation = Vector3.new(45, 0, 0);
  140.     Part6.Color = Color3.new(0.666667, 0, 0.666667);
  141.     Part6.Size = Vector3.new(2.5, 2.5, 2.5);
  142.     Part6.Anchored = true;
  143.     Part6.BottomSurface = Enum.SurfaceType.Smooth;
  144.     Part6.BrickColor = BrickColor.new("Magenta");
  145.     Part6.CanCollide = false;
  146.     Part6.Material = Enum.Material.Fabric;
  147.     Part6.TopSurface = Enum.SurfaceType.Smooth;
  148.     Part6.brickColor = BrickColor.new("Magenta");
  149.        
  150.     if not lfx then
  151.     spawn(function()
  152.         local Decal0 = Instance.new("Decal");
  153.         local Decal1 = Instance.new("Decal");
  154.         local Decal2 = Instance.new("Decal");
  155.         local Decal3 = Instance.new("Decal");
  156.         local Decal4 = Instance.new("Decal");
  157.         local Decal5 = Instance.new("Decal");
  158.         Decal0.Parent = Part6;
  159.         Decal0.Texture = "http://www.roblox.com/asset/?id=4671609130";
  160.         Decal0.Face = Enum.NormalId.Left;
  161.         Decal1.Parent = Part6;
  162.         Decal1.Texture = "http://www.roblox.com/asset/?id=4671609130";
  163.         Decal1.Face = Enum.NormalId.Top;
  164.         Decal2.Parent = Part6;
  165.         Decal2.Texture = "http://www.roblox.com/asset/?id=4671609130";
  166.         Decal2.Face = Enum.NormalId.Right;
  167.         Decal3.Parent = Part6;
  168.         Decal3.Texture = "http://www.roblox.com/asset/?id=4671609130";
  169.         Decal3.Face = Enum.NormalId.Bottom;
  170.         Decal4.Parent = Part6;
  171.         Decal4.Texture = "http://www.roblox.com/asset/?id=4671609130";
  172.         Decal4.Face = Enum.NormalId.Back;
  173.         Decal5.Parent = Part6;
  174.         Decal5.Texture = "http://www.roblox.com/asset/?id=4671609130";
  175.     end);
  176.    
  177.     spawn(function()
  178.         local Decal0 = Instance.new("Decal");
  179.         local Decal1 = Instance.new("Decal");
  180.         local Decal2 = Instance.new("Decal");
  181.         local Decal3 = Instance.new("Decal");
  182.         local Decal4 = Instance.new("Decal");
  183.         local Decal5 = Instance.new("Decal");
  184.         Decal0.Parent = Part4;
  185.         Decal0.Texture = "http://www.roblox.com/asset/?id=4671588152";
  186.         Decal0.Face = Enum.NormalId.Left;
  187.         Decal1.Parent = Part4;
  188.         Decal1.Texture = "http://www.roblox.com/asset/?id=4671588152";
  189.         Decal1.Face = Enum.NormalId.Top;
  190.         Decal2.Parent = Part4;
  191.         Decal2.Texture = "http://www.roblox.com/asset/?id=4671588152";
  192.         Decal2.Face = Enum.NormalId.Right;
  193.         Decal3.Parent = Part4;
  194.         Decal3.Texture = "http://www.roblox.com/asset/?id=4671588152"
  195.         Decal3.Face = Enum.NormalId.Bottom;
  196.         Decal4.Parent = Part4;
  197.         Decal4.Texture = "http://www.roblox.com/asset/?id=4671588152";
  198.         Decal4.Face = Enum.NormalId.Back;
  199.         Decal5.Parent = Part4;
  200.         Decal5.Texture = "http://www.roblox.com/asset/?id=4671588152";
  201.     end);
  202.    
  203.     spawn(function()
  204.         local Decal0 = Instance.new("Decal");
  205.         local Decal1 = Instance.new("Decal");
  206.         local Decal2 = Instance.new("Decal");
  207.         local Decal3 = Instance.new("Decal");
  208.         local Decal4 = Instance.new("Decal");
  209.         local Decal5 = Instance.new("Decal");
  210.         Decal0.Parent = Part1;
  211.         Decal0.Texture = "http://www.roblox.com/asset/?id=4671588152";
  212.         Decal0.Face = Enum.NormalId.Left;
  213.         Decal1.Parent = Part1;
  214.         Decal1.Texture = "http://www.roblox.com/asset/?id=4671588152";
  215.         Decal1.Face = Enum.NormalId.Top;
  216.         Decal2.Parent = Part1;
  217.         Decal2.Texture = "http://www.roblox.com/asset/?id=4671588152";
  218.         Decal2.Face = Enum.NormalId.Right;
  219.         Decal3.Parent = Part1;
  220.         Decal3.Texture = "http://www.roblox.com/asset/?id=4671588152";
  221.         Decal3.Face = Enum.NormalId.Bottom;
  222.         Decal4.Parent = Part1;
  223.         Decal4.Texture = "http://www.roblox.com/asset/?id=4671588152";
  224.         Decal4.Face = Enum.NormalId.Back;
  225.         Decal5.Parent = Part1;
  226.         Decal5.Texture = "http://www.roblox.com/asset/?id=4671588152";
  227.             end);
  228.     else
  229.         Part1.Transparency = 0.7
  230.         Part6.Transparency = 0
  231.         Part4.Transparency = 0.7
  232.     end
  233.    
  234.     local p1,p2,p3,main,model = Part1,Part4,Part6,Part69,Model0;
  235.    
  236.     p1.Locked = true;
  237.     p2.Locked = true;
  238.     p3.Locked = true;
  239.     main.Locked = true;
  240.    
  241.     local exploded = false;
  242.    
  243.     local bvalue = Instance.new("BoolValue");
  244.     bvalue.Parent = model;
  245.     bvalue.Name = 'end crystal explode';
  246.  
  247.     local cvalue = Instance.new("BoolValue");
  248.     cvalue.Parent = model;
  249.     cvalue.Name = 'end crystal chain activated';
  250.    
  251.     workspace.DescendantAdded:Connect(function(obj)
  252.         if obj:IsA("Explosion") then
  253.             obj.Hit:Connect(function(hit)
  254.                 local par = hit.Parent;
  255.                 if par then
  256.                     local c = par:FindFirstChild('end crystal explode');
  257.                     if c and c:IsA("BoolValue") then
  258.                         c.Value = true;
  259.                     end;
  260.                 else
  261.                     return;
  262.                 end;
  263.             end);
  264.         end;
  265.     end);
  266.  
  267.     for i,v in pairs(model:GetDescendants()) do
  268.         if v:IsA("BasePart") and v ~= main then
  269.             local click = Instance.new("ClickDetector");
  270.             click.MaxActivationDistance = 30;
  271.             click.CursorIcon = 'rbxassetid://93681360';
  272.             click.Parent = v;
  273.        
  274.             click.MouseClick:Connect(function()
  275.                 click:Destroy();
  276.                 bvalue.Value = true;
  277.             end);
  278.         end;
  279.     end;
  280.    
  281.     local function explode(par,poss)
  282.         if not exploded then else return end
  283.         exploded = true;
  284.         bvalue.Value = true;
  285.         model:Destroy()
  286.         --p1:Destroy();p2:Destroy();p3:Destroy();main:Destroy();
  287.         local Part0 = Instance.new("Part");
  288.         --local ParticleEmitter1 = Instance.new("ParticleEmitter");
  289.         Part0.Name = "grenade";
  290.         Part0.Parent = par;
  291.         Part0.Position = poss;
  292.         Part0.Transparency = 1;
  293.         Part0.Size = Vector3.new(4, 0.0500000007, 4);
  294.         Part0.Anchored = true;
  295.         Part0.BottomSurface = Enum.SurfaceType.Smooth;
  296.         Part0.CanCollide = false;
  297.         Part0.Locked = true;
  298.         Part0.TopSurface = Enum.SurfaceType.Smooth;
  299.         --[[
  300.         ParticleEmitter1.Parent = Part0;
  301.         ParticleEmitter1.Speed = NumberRange.new(25,30);
  302.         ParticleEmitter1.Color = ColorSequence.new(Color3.new(1,1,1),Color3.new(1,1,1));
  303.         ParticleEmitter1.Enabled = false;
  304.         ParticleEmitter1.LightEmission = 0.80000001192093;
  305.         ParticleEmitter1.Texture = "rbxassetid://3607612871";
  306.         ParticleEmitter1.Size = NumberSequence.new(3,0.5);
  307.         ParticleEmitter1.Lifetime = NumberRange.new(0.80000001192093, 0.80000001192093);
  308.         ParticleEmitter1.LockedToPart = true;
  309.         ParticleEmitter1.Rate = 10000;
  310.         ParticleEmitter1.RotSpeed = NumberRange.new(270, 270);
  311.         ParticleEmitter1.SpreadAngle = Vector2.new(-90, -90);
  312.         ParticleEmitter1.VelocitySpread = -90;
  313.         ]]
  314.         if cvalue.Value == false then
  315.             local selectedtimepos = maintimepos + 1;
  316.             if selectedtimepos > #explosionstimepos then
  317.                 selectedtimepos = 1;
  318.             end;
  319.             maintimepos = selectedtimepos;
  320.             local s = Instance.new("Sound");
  321.             s.Parent = Part0;
  322.             s.SoundId = "rbxassetid://4673732522";
  323.             s.Volume = 4;
  324.             s.PlaybackSpeed = math.random(10,11)/10;
  325.             s.TimePosition = explosionstimepos[math.random(1,#explosionstimepos)];
  326.             s:Play();
  327.             game:GetService("Debris"):AddItem(s,3.9);
  328.         end;
  329.         used = used + 1
  330.         local radius,mindmg,maxdmg,crystalid,crystalid2 = 10,10,100,math.random(-9999999999,9999999999),math.random(-9999999999,9999999999);
  331.             Swait()
  332.         local ex = Instance.new("Explosion");
  333.         ex.Visible = true;
  334.         ex.Position = poss;
  335.         ex.BlastRadius = 20;
  336.         ex.BlastPressure = 100000;
  337.         ex.DestroyJointRadiusPercent = 0;
  338.         ex.ExplosionType = Enum.ExplosionType.NoCraters;
  339.         ex.Parent = Part0;
  340.         debris:AddItem(Part0,2);
  341.         debris:AddItem(ex,2);
  342.         ex.Hit:connect(function(obj, Distance)
  343.             if Distance <= 20 and obj ~= Part0 then
  344.                 local targchar,targhum,targtorso,targhead,targleg1,targleg2,targarm1,targarm2,confirm;
  345.                 pcall(function()
  346.                     targchar = obj.Parent;
  347.                 end);
  348.                 pcall(function()
  349.                     targhum = targchar:FindFirstChildOfClass("Humanoid");
  350.                 end);
  351.                 pcall(function()
  352.                     targtorso = targchar:FindFirstChild("HumanoidRootPart") or targchar:FindFirstChild("Torso");
  353.                 end);
  354.                 pcall(function()
  355.                     targhead = targchar:FindFirstChild("Head");
  356.                 end);
  357.                 pcall(function()
  358.                     targleg1 = targchar:FindFirstChild("Left Leg") or targchar:FindFirstChild("LeftUpperLeg");
  359.                 end);
  360.                 pcall(function()
  361.                     targleg2 = targchar:FindFirstChild("Right Leg") or targchar:FindFirstChild("RightUpperLeg");
  362.                 end);
  363.                 pcall(function()
  364.                     targarm1 = targchar:FindFirstChild("Left Arm") or targchar:FindFirstChild("LeftUpperArm");
  365.                 end);
  366.                 pcall(function()
  367.                     targarm2 = targchar:FindFirstChild("Right Arm") or targchar:FindFirstChild("RightUpperArm");
  368.                 end);
  369.                 pcall(function()
  370.                     confirm = targhum:FindFirstChild(crystalid .. used .. plr.Name .. crystalid2);
  371.                 end);
  372.                 local par = obj.Parent;
  373.                 if par then
  374.                     local c = par:FindFirstChild('end crystal chain activated');
  375.                     if c and c:IsA("BoolValue") then
  376.                         c.Value = true;
  377.                     end;
  378.                 else
  379.                     return;
  380.                 end;
  381.                 if targchar and targhum and targtorso and targhead and targleg1 and targleg2 and targarm1 and targarm2 and not confirm then
  382.                     local ec_dmg = 100
  383.                     local ignore = {partfolder,Part0,targchar,script};
  384.                     for i,v in ipairs(game:GetService("Players"):GetPlayers()) do
  385.                         if v and v.Character then
  386.                             table.insert(ignore,1,v.Character);
  387.                         end;
  388.                     end;
  389.                     local ray1 = Ray.new(poss, (targtorso.Position-poss));
  390.                     local hit1 = workspace:FindPartOnRayWithIgnoreList(ray1,ignore,false,true);
  391.                     if hit1 then
  392.                         ec_dmg = ec_dmg - 20;
  393.                         --return;
  394.                     end;
  395.                     local ray2 = Ray.new(poss, (targleg1.Position-poss));
  396.                     local hit2 = workspace:FindPartOnRayWithIgnoreList(ray2,ignore,false,true);
  397.                     if hit2 then
  398.                         ec_dmg = ec_dmg - 20--20;
  399.                     end;
  400.                     local ray3 = Ray.new(poss, (targleg2.Position-poss));
  401.                     local hit3 = workspace:FindPartOnRayWithIgnoreList(ray3,ignore,false,true);
  402.                     if hit3 then
  403.                         ec_dmg = ec_dmg - 20--20;
  404.                     end;
  405.                     --[[
  406.                     local ray4 = Ray.new(poss, (targhead.Position-poss));
  407.                     local hit4 = workspace:FindPartOnRayWithIgnoreList(ray4,ignore,false,true);
  408.                     if hit4 then
  409.                         ec_dmg = ec_dmg - 20;
  410.                     end;
  411.                     ]]
  412.                     --[[
  413.                     local ray5 = Ray.new(poss, (targarm1.Position-poss));
  414.                     local hit5 = workspace:FindPartOnRayWithIgnoreList(ray5,ignore,false,true);
  415.                     if hit5 then
  416.                         ec_dmg = ec_dmg - 20;
  417.                     end;
  418.                     ]]
  419.                     --[[
  420.                     local ray6 = Ray.new(poss, (targarm2.Position-poss));
  421.                     local hit6 = workspace:FindPartOnRayWithIgnoreList(ray6,ignore,false,true);
  422.                     if hit6 then
  423.                         ec_dmg = ec_dmg - 20;
  424.                     end;
  425.                     ]]
  426.                     local targY = targtorso.Position.Y;
  427.                     local dh = (targY-poss.Y)
  428.                     local confirm = Instance.new("IntValue");
  429.                     confirm.Name = (crystalid .. used .. plr.Name .. crystalid2);
  430.                     confirm.Parent = targhum;
  431.                     game:GetService("Debris"):AddItem(confirm,1);
  432.                     if dh >= -2 then
  433.                         --print('hight;' .. dh)
  434.                         if dh >= 0.79 then
  435.                             targhum:TakeDamage(5+ec_dmg);
  436.                             --print('dmg;' .. 5+ec_dmg)
  437.                         elseif (5+ec_dmg-60) > 0 then
  438.                             targhum:TakeDamage(5+ec_dmg-40);
  439.                             --print('dmg;' .. 5+ec_dmg-60)
  440.                         end;
  441.                     elseif -2 > dh then
  442.                         local down = poss.Y - targY;
  443.                         targhum:TakeDamage(5);
  444.                     end;
  445.                 end;
  446.             end;
  447.         end);
  448.         spawn(function()
  449.             --[[
  450.             ParticleEmitter1.Enabled = true;
  451.             wait(.25);
  452.             ParticleEmitter1.Enabled = false;
  453.             ]]
  454.         end);
  455.     end;
  456.        
  457.     --[[
  458.     local humanoid = Instance.new("Humanoid")
  459.     humanoid.Parent = model
  460.     humanoid.MaxHealth = 1
  461.     humanoid.Health = 1
  462.     humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  463.     humanoid.HealthDisplayDistance = Enum.HumanoidHealthDisplayType.AlwaysOff
  464.     humanoid.HealthChanged:Connect(function()
  465.         if bvalue.Value == true then
  466.             explode(workspace,main.Position);
  467.         end;
  468.     end)
  469.     ]]
  470.    
  471.     bvalue.Changed:Connect(function()
  472.         if bvalue.Value == true then
  473.             explode(workspace,main.Position);
  474.         end;
  475.     end);
  476.    
  477.     local sine = 0;
  478.     spawn(function()
  479.         local base_speed = 0.025;
  480.         local speed1,speed2,speed3 = base_speed/2,base_speed/3,base_speed/1.5;
  481.         p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(45,0,0);
  482.         p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(45,0,0);
  483.         table.insert(crystals,1,{p1 = p1,p2 = p2,p3 = p3})
  484.         --[[
  485.         while not exploded do
  486.             game:GetService("RunService").Heartbeat:Wait(1/30);
  487.             sine = sine+2;
  488.             p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(0,speed2,speed2);
  489.             p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(0,speed1,speed1);
  490.             p3.CFrame = p3.CFrame*CFrame.fromEulerAnglesXYZ(speed3,speed3,0);
  491.             p1.Position = p1.Position+Vector3.new(0,0.12*math.cos(sine/24),0);
  492.             p2.Position = p2.Position+Vector3.new(0,0.12*math.cos(sine/24),0);
  493.             p3.Position = p3.Position+Vector3.new(0,0.12*math.cos(sine/24),0);
  494.         end;
  495.         ]]
  496.     end);
  497. end;
  498.  
  499. local function CheckIfAlive()
  500.     local alive = false;
  501.     if (plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 and torso and torso.Parent) then
  502.         alive = true;
  503.     end;
  504.     return alive;
  505. end;
  506.  
  507. local equipped = false;
  508.  
  509. local tool = Instance.new("Tool");
  510. local handle = Instance.new("Part");
  511. local Decal2 = Instance.new("Decal");
  512. local Decal3 = Instance.new("Decal");
  513. tool.Name = "End Crystal";
  514.     tool.Parent = nil;
  515. tool.CanBeDropped = false;
  516. tool.TextureId = "rbxassetid://4124593233";
  517. tool.Grip = CFrame.new(-2.54576662e-08, -0.0455678105, 0.308264196, -0.99999994, 1.61091539e-05, 6.31738794e-06, -1.62063188e-05, -0.9998703, -0.0161100924, 6.06379626e-06, -0.0161101501, 0.999870241);
  518. tool.ToolTip = "Keep cautious! Flammable!";
  519. tool.CanBeDropped = false;
  520. handle.Name = "Handle";
  521. handle.Parent = tool;
  522. handle.CFrame = CFrame.new(-87.6886597, 2.380023, 164.558884, 1, 0, 0, 0, 1, 0, 0, 0, 1);
  523. handle.Position = Vector3.new(-87.6886597, 2.380023, 164.558884);
  524. handle.Transparency = 1;
  525. handle.Size = Vector3.new(0.05, 2, 2);
  526. handle.BottomSurface = Enum.SurfaceType.Smooth;
  527. handle.CanCollide = true;
  528. handle.Massless = true;
  529. handle.Anchored = false;
  530. handle.TopSurface = Enum.SurfaceType.Smooth;
  531. Decal2.Parent = handle;
  532. Decal2.Texture = "rbxassetid://4124593233";
  533. Decal2.Face = Enum.NormalId.Right;
  534. Decal3.Parent = handle;
  535. Decal3.Texture = "rbxassetid://4124593233";
  536. Decal3.Face = Enum.NormalId.Left;
  537.  
  538. tool.Equipped:Connect(function()
  539.     char = tool.Parent;
  540.     plr = game:GetService("Players"):GetPlayerFromCharacter(char);
  541.     hum = char:FindFirstChildOfClass("Humanoid");
  542.     torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart");
  543.     if not CheckIfAlive() then tool.Parent = nil return end;
  544.     equipped = true;
  545. end);
  546.  
  547. tool.Unequipped:Connect(function()
  548.     equipped = false;
  549. end);
  550.    
  551. tool.Parent = char;
  552.  
  553. local crystalremote = Instance.new("RemoteEvent");
  554. crystalremote.Name = 'crystalremote';
  555. crystalremote.Parent = char;
  556.  
  557. local lscode = [[
  558.     local plr = game:GetService("Players").LocalPlayer;
  559.     local mouse = plr:GetMouse();
  560.     local crystalremote = script.Parent;
  561.    
  562.     mouse.Button1Down:Connect(function()
  563.         local mpos = mouse.hit.p;
  564.         crystalremote:FireServer(1,mpos);
  565.     end);
  566.     mouse.KeyDown:Connect(function(key)
  567.         local targ = mouse.Target;
  568.         if key == 'q' and targ then
  569.             pcall(function()
  570.                 local par = targ.Parent;
  571.                 if par then
  572.                     local c = par:FindFirstChild('end crystal explode');
  573.                     if c and c:IsA("BoolValue") then
  574.                         --c.Value = true;
  575.                         crystalremote:FireServer(2,c,targ);
  576.                     end;
  577.                 else
  578.                     return;
  579.                 end;
  580.             end);
  581.         end;
  582.     end);
  583. ]]
  584.  
  585. NLS(lscode,crystalremote);
  586. local chitanimid = 0;
  587. local cooldown = false
  588.  
  589. crystalremote.OnServerEvent:Connect(function(plr,mode,data,data2)
  590.     if mode == 1 and data and CheckIfAlive() and equipped then
  591.         if not cooldown then else return end
  592.         cooldown = true
  593.         spawn(function()
  594.             chitanimid = 1;
  595.             if chitanimid == 1 then else return end
  596.             tween:Create(tool,TweenInfo.new(0.12),{Grip = CFrame.new(5.07131972e-08, 0.381923676, -0.0852522179, -0.999999881, 1.61091466e-05, 6.31792e-06, 6.26118799e-06, -0.00393574359, 0.999992192, 1.61312892e-05, 0.999992251, 0.00393568445)}):Play();
  597.             chitanimid = 2;
  598.             wait(0.08);
  599.             if chitanimid == 2 then else return end
  600.             tween:Create(tool,TweenInfo.new(0.12),{Grip = CFrame.new(-0.0180762839, -0.0653070137, -0.0547990054, 6.30489922e-06, -0.00393574359, 0.999992192, 0.642799735, 0.766028285, 0.00301082013, -0.766034126, 0.642794847, 0.0025346817)}):Play();
  601.             chitanimid = 3;
  602.             wait(0.04);
  603.             if chitanimid == 3 then else return end
  604.             tween:Create(tool,TweenInfo.new(0.12),{Grip = CFrame.new(-2.54576662e-08, -0.0455678105, 0.308264196, -0.99999994, 1.61091539e-05, 6.31738794e-06, -1.62063188e-05, -0.9998703, -0.0161100924, 6.06379626e-06, -0.0161101501, 0.999870241)}):Play();
  605.         end)
  606.         createcrystal(data+Vector3.new(0,4,0));
  607.         wait(0.1)
  608.         cooldown = false
  609.     elseif mode == 2 and data and data2 then
  610.         pcall(function()
  611.             local dist = (torso.Position - data2.Position).Magnitude
  612.             if 30 >= dist then else return end
  613.             data.Value = true;
  614.         end);
  615.     end;
  616. end);
  617. end
  618.  
  619. warn([[
  620. AlmightyToast's Totem
  621. - press e to auto equip
  622. - q or click to detonate crystal
  623. - 10 totems
  624. - inf crystals
  625. - auto equip on death
  626. ]])
  627.  
  628. local totem = nil
  629. local left = 10
  630. local oldchar = nil
  631. local auto = false
  632. local oldpos = CFrame.new()
  633.  
  634. local remote = Instance.new("RemoteEvent")
  635. remote.Name = "KrY's Totem"
  636. remote.Parent = owner['PlayerGui']
  637.  
  638. local code = [[
  639. plr = game:GetService("Players").LocalPlayer
  640. mouse = plr:GetMouse()
  641. remote = script.Parent
  642.  
  643. mouse.KeyDown:Connect(function(k)
  644.     if k == 'e' then
  645.         remote:FireServer()
  646.     end
  647. end)
  648. ]]
  649.  
  650. NLS(code,remote)
  651.  
  652. remote.OnServerEvent:Connect(function(plr)
  653.     auto = not auto
  654. end)
  655.  
  656. function effect(p,h)
  657.     local Part0 = Instance.new("Part")
  658.     local ParticleEmitter1 = Instance.new("ParticleEmitter")
  659.     Part0.Name = "effects"
  660.     Part0.Parent = p
  661.     Part0.CFrame = CFrame.new(-5.20499992, 2.68487453, -24.0999928, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  662.     Part0.Position = Vector3.new(-5.20499992, 2.68487453, -24.0999928)
  663.     Part0.Transparency = 1
  664.     Part0.Size = Vector3.new(2.39999962, 5.17000914, 0.970000446)
  665.     Part0.BottomSurface = Enum.SurfaceType.Smooth
  666.     Part0.TopSurface = Enum.SurfaceType.Smooth
  667.     Part0.Anchored = false
  668.     ParticleEmitter1.Parent = Part0
  669.     ParticleEmitter1.Speed = NumberRange.new(2, 2)
  670.     ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0),Color3.new(0.309804, 1, 0.898039))
  671.     ParticleEmitter1.LightEmission = 0.80000001192093
  672.     ParticleEmitter1.Texture = "http://www.roblox.com/asset/?id=241650934"
  673.     ParticleEmitter1.Size = NumberSequence.new(1,0)
  674.     ParticleEmitter1.Lifetime = NumberRange.new(1, 1)
  675.     ParticleEmitter1.LockedToPart = true
  676.     ParticleEmitter1.Rate = 250
  677.     ParticleEmitter1.SpreadAngle = Vector2.new(45, 45)
  678.     ParticleEmitter1.VelocitySpread = 45
  679.     local tempweld = Instance.new("Weld")
  680.     tempweld.Parent = Part0
  681.     tempweld.Part0 = p
  682.     tempweld.Part1 = Part0
  683.     tempweld.C0 = p.CFrame:Inverse()
  684.     tempweld.C1 = Part0.CFrame:Inverse()
  685.     tempweld.C0 = CFrame.new(0,0,0)
  686.     spawn(function()
  687.         ParticleEmitter1.Enabled = true
  688.         wait(1)
  689.         ParticleEmitter1.Rate = 100
  690.         wait(.5)
  691.         ParticleEmitter1.Rate = 50
  692.         wait(.5)
  693.         ParticleEmitter1.Rate = 0
  694.         wait(2)
  695.         Part0:Destroy()
  696.         tempweld:Destroy()
  697.         ParticleEmitter1.Enabled = false
  698.     end)
  699. end
  700.  
  701. function spawntotem()
  702.     local plr = owner
  703.     local char = plr.Character
  704.     local torso = char:FindFirstChild("HumanoidRootPart")
  705.     local hum = char:FindFirstChildOfClass("Humanoid")
  706.     local holding = auto
  707.     local died = false
  708.    
  709.     local function alive()
  710.         local alive = false
  711.         if char and char.Parent and torso and torso.Parent and hum and hum.Parent and hum.Health > 0 then
  712.             alive = true
  713.         end
  714.         return alive
  715.     end
  716.  
  717.     local function rebirth()
  718.         hum.BreakJointsOnDeath = false
  719.         plr:LoadCharacter()
  720.         repeat wait() until plr.Character
  721.         char = plr.Character
  722.         torso = char:FindFirstChild("HumanoidRootPart")
  723.         hum = char:FindFirstChildOfClass("Humanoid")
  724.         local ff = char:FindFirstChildOfClass("ForceField")
  725.         hum.Health = 20
  726.         if ff then
  727.             ff:Destroy()
  728.         end
  729.         if torso then
  730.             torso.Velocity = Vector3.new()
  731.             torso.CFrame = oldpos
  732.         end
  733.         if hum then
  734.             hum.Sit = false
  735.             hum.PlatformStand = false
  736.             hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
  737.             hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
  738.         end
  739.         spawn(function()
  740.             local o1 = Instance.new("Part")
  741.             local o2 = Instance.new("ParticleEmitter")
  742.             o1.Name = "effects"
  743.             o1.Parent = char
  744.             o1.Transparency = 1
  745.             o1.Rotation = Vector3.new(0.0500000007, 0, -0.0199999996)
  746.             o1.Size = Vector3.new(2.39999962, 5.17000914, 0.970000446)
  747.             o1.CFrame = CFrame.new(-0.00269600004, 2.58585, 0.00243000011, 0.99999994, 0.000345684297, 6.2623044e-06, -0.000345678796, 0.999999583, -0.000859424355, -6.5593913e-06, 0.000859422144, 0.999999642)
  748.             o1.BottomSurface = Enum.SurfaceType.Smooth
  749.             o1.TopSurface = Enum.SurfaceType.Smooth
  750.             o2.Parent = o1
  751.             o2.Size = NumberSequence.new(0.74999988079071,0.5,0)
  752.             o2.Color = ColorSequence.new(Color3.new(0.666667, 0.666667, 0.666667),Color3.new(0.666667, 0.666667, 0.666667))
  753.             o2.LightEmission = 0.80000001192093
  754.             o2.Texture = "rbxassetid://3552571288"
  755.             o2.Lifetime = NumberRange.new(2,2)
  756.             o2.Rate = 1
  757.             o2.RotSpeed = NumberRange.new(270,270)
  758.             o2.Speed = NumberRange.new(1.5,1.5)
  759.             o2.VelocitySpread = 45
  760.             o2.Color = ColorSequence.new(Color3.new(0.666667, 0.666667, 0.666667),Color3.new(0.666667, 0.666667, 0.666667))
  761.             local tempweld2 = Instance.new("Weld")
  762.             tempweld2.Parent = o1
  763.             tempweld2.Part0 = torso
  764.             tempweld2.Part1 = o1
  765.             game:GetService("Debris"):AddItem(o1,7)
  766.             local regen = true
  767.             spawn(function()
  768.                 while regen and (hum.Health > 0) do
  769.                     wait(0.25)
  770.                     hum.Health = hum.Health + 5
  771.                 end
  772.             end)
  773.             wait(5)
  774.             regen = false
  775.         end)
  776.         spawn(function()
  777.             local o1 = Instance.new("Part")
  778.             local o2 = Instance.new("Attachment")
  779.             local o3 = Instance.new("ParticleEmitter")
  780.             local o4 = Instance.new("ParticleEmitter")
  781.             o1.Parent = workspace
  782.             o1.Transparency = 1
  783.             o1.Anchored = true
  784.             o1.CanCollide = false
  785.             o1.Size = Vector3.new(25, 1, 25)
  786.             o1.Position = oldpos.Position - Vector3.new(0,2.5,0)
  787.             o1.BottomSurface = Enum.SurfaceType.Smooth
  788.             o1.TopSurface = Enum.SurfaceType.Smooth
  789.             o2.Parent = o1
  790.             o3.Parent = o2
  791.             o3.Size = NumberSequence.new(0.24999976158142,0.37499964237213,0)
  792.             o3.Color = ColorSequence.new(Color3.new(0.333333, 1, 0),Color3.new(0.333333, 1, 0),Color3.new(0, 0.666667, 0),Color3.new(0, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0.519689, 1, 0.139219),Color3.new(1, 0.333333, 0),Color3.new(1, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0, 1, 0),Color3.new(1, 0.666667, 0),Color3.new(1, 1, 0.498039))
  793.             o3.LightEmission = 0.75
  794.             o3.Texture = "rbxassetid://2434785466"
  795.             o3.Acceleration = Vector3.new(0, -25, 0)
  796.             o3.Lifetime = NumberRange.new(3,3)
  797.             o3.Rate = 300
  798.             o3.Speed = NumberRange.new(25,25)
  799.             o3.VelocitySpread = 45
  800.             o3.Color = ColorSequence.new(Color3.new(0.333333, 1, 0),Color3.new(0.333333, 1, 0),Color3.new(0, 0.666667, 0),Color3.new(0, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0.519689, 1, 0.139219),Color3.new(1, 0.333333, 0),Color3.new(1, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0, 1, 0),Color3.new(1, 0.666667, 0),Color3.new(1, 1, 0.498039))
  801.             o4.Parent = o1
  802.             o4.Size = NumberSequence.new(0.24999976158142,0.37499964237213,0)
  803.             o4.Color = ColorSequence.new(Color3.new(0.333333, 1, 0),Color3.new(0.333333, 1, 0),Color3.new(0, 0.666667, 0),Color3.new(0, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0.519689, 1, 0.139219),Color3.new(1, 0.333333, 0),Color3.new(1, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0, 1, 0),Color3.new(1, 0.666667, 0),Color3.new(1, 1, 0.498039))
  804.             o4.LightEmission = 0.75
  805.             o4.Texture = "rbxassetid://2434785466"
  806.             o4.Lifetime = NumberRange.new(3,3)
  807.             o4.Rate = 100
  808.             o4.Speed = NumberRange.new(0,0)
  809.             o4.Color = ColorSequence.new(Color3.new(0.333333, 1, 0),Color3.new(0.333333, 1, 0),Color3.new(0, 0.666667, 0),Color3.new(0, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0.519689, 1, 0.139219),Color3.new(1, 0.333333, 0),Color3.new(1, 1, 0),Color3.new(0.333333, 1, 0.498039),Color3.new(0, 1, 0),Color3.new(1, 0.666667, 0),Color3.new(1, 1, 0.498039))
  810.             local sound = Instance.new("Sound")
  811.             sound.Parent = o1
  812.             sound.SoundId = "rbxassetid://3552283822"
  813.             sound.Volume = 1.5
  814.             sound:Play()
  815.             wait(2)
  816.             o4.Enabled = false
  817.             o3.Enabled = false
  818.         end)
  819.         --effect(torso,hum)
  820.         if (left > 0) then
  821.             spawntotem()
  822.         end
  823.         spawn_crystal()
  824.         spawngapple()
  825.     end
  826.  
  827.     totem = Instance.new("Tool")
  828.     local o2 = Instance.new("Part")
  829.     local o3 = Instance.new("Decal")
  830.     local o4 = Instance.new("Decal")
  831.     local o5 = Instance.new("Part")
  832.     totem.Name = "Totem of Undying"
  833.     totem.Parent = plr.Backpack
  834.     o2.Name = "part"
  835.     o2.Parent = totem
  836.     o2.Transparency = 1
  837.     o2.Rotation = Vector3.new(-82.4100037, 1.04999995, 17.8500004)
  838.     o2.Size = Vector3.new(0.600000024, 0.0500000007, 1.25)
  839.     o2.CFrame = CFrame.new(14.8800182, 0.663631022, 12.8549995, 0.951727092, -0.306400239, 0.01828775, 0.0232320018, 0.131314978, 0.991068482, -0.306065023, -0.942801833, 0.132094339)
  840.     o2.BottomSurface = Enum.SurfaceType.Smooth
  841.     o2.TopSurface = Enum.SurfaceType.Smooth
  842.     o3.Parent = o2
  843.     o3.Texture = "rbxassetid://3551524140"
  844.     o3.Face = Enum.NormalId.Top
  845.     o4.Parent = o2
  846.     o4.Texture = "rbxassetid://3551524140"
  847.     o4.Face = Enum.NormalId.Bottom
  848.     o5.Name = "Handle"
  849.     o5.Parent = totem
  850.     o5.Transparency = 1
  851.     o5.Rotation = Vector3.new(-68.7200012, 5.36999989, -29.9599991)
  852.     o5.Size = Vector3.new(0.100000001, 0.100000001, 0.100000001)
  853.     o5.CFrame = CFrame.new(14.9258261, 0.462755978, 12.3108463, 0.862572074, 0.497210532, 0.0935470909, -0.256796867, 0.270954847, 0.927706182, 0.435918272, -0.824236095, 0.361400247)
  854.     o5.BottomSurface = Enum.SurfaceType.Smooth
  855.     o5.TopSurface = Enum.SurfaceType.Smooth
  856.    
  857.     for i,v in pairs(totem:GetDescendants()) do
  858.         if v:IsA("Part") then
  859.             v.CanCollide = false
  860.             v.Massless = true
  861.         end
  862.     end
  863.    
  864.     totem.CanBeDropped = false
  865.    
  866.     local w1 = Instance.new("Weld")
  867.     w1.Parent = o5
  868.     w1.Part0 = o5
  869.     w1.Part1 = o2
  870.     w1.C0 = o5.CFrame:Inverse()
  871.     w1.C1 = o2.CFrame:Inverse()
  872.     w1.C0 = CFrame.new(-15,0.2,-12.6)
  873.    
  874.     spawn(function()
  875.         while not died do
  876.             game:GetService("RunService").Heartbeat:Wait(1/30)
  877.             if alive() then
  878.                 oldpos = torso.CFrame
  879.             end
  880.             if totem and auto then
  881.                 totem.Parent = char
  882.             end
  883.             if not alive() then
  884.                 died = true
  885.             end
  886.             if not alive() and (holding or auto) then
  887.                 left = left - 1
  888.                 rebirth()
  889.             end
  890.         end
  891.     end)
  892.    
  893.     totem.Unequipped:Connect(function()
  894.         holding = false
  895.     end)
  896.    
  897.     totem.Equipped:Connect(function()
  898.         holding = true
  899.     end)
  900. end
  901.  
  902. function effect2(par,tarhum,weld,health_boost,duration)
  903.     local o1 = Instance.new("Part")
  904.     local o2 = Instance.new("ParticleEmitter")
  905.     o1.Name = "effects"
  906.     o1.Parent = par
  907.     o1.Transparency = 1
  908.     o1.Rotation = Vector3.new(0.0500000007, 0, -0.0199999996)
  909.     o1.Size = Vector3.new(2.39999962, 5.17000914, 0.970000446)
  910.     o1.CFrame = CFrame.new(-0.00269600004, 2.58585, 0.00243000011, 0.99999994, 0.000345684297, 6.2623044e-06, -0.000345678796, 0.999999583, -0.000859424355, -6.5593913e-06, 0.000859422144, 0.999999642)
  911.     o1.BottomSurface = Enum.SurfaceType.Smooth
  912.     o1.TopSurface = Enum.SurfaceType.Smooth
  913.     o2.Parent = o1
  914.     o2.Size = NumberSequence.new(0.74999988079071,0.5,0)
  915.     o2.Color = ColorSequence.new(Color3.new(0.666667, 0.666667, 0.666667),Color3.new(0.666667, 0.666667, 0.666667))
  916.     o2.LightEmission = 0.80000001192093
  917.     o2.Texture = "rbxassetid://3552571288"
  918.     o2.Lifetime = NumberRange.new(2,2)
  919.     o2.Rate = 1.5
  920.     o2.RotSpeed = NumberRange.new(270,270)
  921.     o2.Speed = NumberRange.new(1.5,1.5)
  922.     o2.VelocitySpread = 45
  923.     o2.Color = ColorSequence.new(Color3.new(0.666667, 0.666667, 0.666667),Color3.new(0.666667, 0.666667, 0.666667))
  924.     local tempweld2 = Instance.new("Weld")
  925.     tempweld2.Parent = o1
  926.     tempweld2.Part0 = weld
  927.     tempweld2.Part1 = o1
  928.     tempweld2.C0 = weld.CFrame:Inverse()
  929.     tempweld2.C1 = o1.CFrame:Inverse()
  930.     tempweld2.C0 = CFrame.new(0,0,0)
  931.     o2.Enabled = true
  932.     local cc,chealth,effecting,hit = nil,tarhum.Health,true,false
  933.     local extra_health = nil
  934.     spawn(function()
  935.         wait(duration)
  936.         effecting = false
  937.         if o2 then
  938.             o2:Destroy()
  939.         end
  940.     end)
  941.     cc = tarhum.HealthChanged:Connect(function(health)
  942.         --[[
  943.         if chealth > health then
  944.             tarhum.Health = health + ((chealth-health)*0.2)
  945.             --print('old hp:' .. health .. '\n' .. 'new hp:' .. tarhum.Health .. '\n' .. 'deflected dmg:' .. ((chealth-health)*0.2))
  946.             health = health + (chealth-health)*0.2
  947.         end
  948.         ]]
  949.         if tarhum.Health >= chealth then chealth = health; return; end;
  950.         if not extra_health then hit = true; cc:Disconnect(); return; end;
  951.         if extra_health and health > 100 then
  952.             hit = true
  953.             extra_health.Value = extra_health.Value - (chealth - health);
  954.             tarhum.MaxHealth = 100 + extra_health.Value;
  955.         elseif extra_health and 100 > health then
  956.             hit = true
  957.             if extra_health and 0 >= extra_health.Value then
  958.                 tarhum.MaxHealth = 100
  959.             elseif extra_health and extra_health.Value > 0 then
  960.                 extra_health.Value = extra_health.Value - (chealth - health)
  961.                 tarhum.MaxHealth = 100 + extra_health.Value
  962.             end
  963.         end
  964.         if extra_health and 0 >= extra_health.Value then
  965.             tarhum.MaxHealth = 100
  966.             cc:Disconnect()
  967.             hit = true
  968.             if extra_health then
  969.                 extra_health:Destroy()
  970.             end
  971.         end
  972.         chealth = health
  973.     end)
  974.     local e_h = tarhum:FindFirstChild("extra_health")
  975.     if e_h then
  976.         e_h:Destroy()
  977.     end
  978.     extra_health = Instance.new("NumberValue")
  979.     extra_health.Name = 'extra_health'
  980.     extra_health.Value = health_boost
  981.     extra_health.Parent = tarhum
  982.     tarhum.MaxHealth = 100 + health_boost
  983.     tarhum.Health = tarhum.Health + health_boost
  984.     spawn(function()
  985.         while tarhum and effecting do
  986.             tarhum.Health = tarhum.Health + 5
  987.             wait(1)
  988.         end
  989.         --[[
  990.         while not hit and extra_health do
  991.             tarhum.Health = tarhum.Health + 10*0.4
  992.             wait(1.25)
  993.         end
  994.         ]]
  995.     end)
  996. end
  997.  
  998. function spawngapple()
  999.     local plr = owner
  1000.     local char = plr.Character
  1001.     local torso = char:FindFirstChild("HumanoidRootPart")
  1002.     local hum = char:FindFirstChildOfClass("Humanoid")
  1003.     local gappletool = Instance.new("Tool")
  1004.     local gapple = Instance.new("Part")
  1005.     local Decal2 = Instance.new("Decal")
  1006.     local Decal3 = Instance.new("Decal")
  1007.     gappletool.Name = "Enchanted Golden Apple"
  1008.     gappletool.Parent = plr.Backpack
  1009.     gappletool.TextureId = "rbxassetid://3749318589"
  1010.     gappletool.Grip = CFrame.new(0.194969162, -0.202951327, 0, 1, 0, -1.74845553e-07, 2.16089315e-08, 0.992333531, 0.123588681, 1.735051e-07, -0.123588681, 0.992333531)
  1011.     gappletool.GripForward = Vector3.new(1.74845553e-07, -0.123588681, -0.992333531)
  1012.     gappletool.GripPos = Vector3.new(0.194969162, -0.202951327, 0)
  1013.     gappletool.GripRight = Vector3.new(1, 2.16089315e-08, 1.735051e-07)
  1014.     gappletool.GripUp = Vector3.new(0, 0.992333531, -0.123588681)
  1015.     gappletool.ToolTip = "Left: 1/0"
  1016.     gapple.Name = "Handle"
  1017.     gapple.Parent = gappletool
  1018.     gapple.CFrame = CFrame.new(-87.6886597, 2.380023, 164.558884, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1019.     gapple.Position = Vector3.new(-87.6886597, 2.380023, 164.558884)
  1020.     gapple.Transparency = 1
  1021.     gapple.Size = Vector3.new(0.0500000007, 1, 1)
  1022.     gapple.BottomSurface = Enum.SurfaceType.Smooth
  1023.     gapple.CanCollide = false
  1024.     gapple.TopSurface = Enum.SurfaceType.Smooth
  1025.     Decal2.Parent = gapple
  1026.     Decal2.Texture = "rbxassetid://3749318589"
  1027.     Decal2.Face = Enum.NormalId.Right
  1028.     Decal3.Parent = gapple
  1029.     Decal3.Texture = "rbxassetid://3749318589"
  1030.     Decal3.Face = Enum.NormalId.Left
  1031.    
  1032.     local trans = 0.6
  1033.     local speed = 0.05
  1034.     local size = 3
  1035.     local Texture0 = Instance.new("Texture")
  1036.     local Texture1 = Instance.new("Texture")
  1037.     local Texture2 = Instance.new("Texture")
  1038.     local Texture3 = Instance.new("Texture")
  1039.     local Texture4 = Instance.new("Texture")
  1040.     local Texture5 = Instance.new("Texture")
  1041.     Texture0.Parent = gapple
  1042.     Texture0.Texture = "rbxassetid://4771489612"
  1043.     Texture0.Transparency = trans
  1044.     Texture0.Face = Enum.NormalId.Bottom
  1045.     Texture0.StudsPerTileU = size
  1046.     Texture0.StudsPerTileV = size
  1047.     Texture1.Parent = gapple
  1048.     Texture1.Texture = "rbxassetid://4771489612"
  1049.     Texture1.Transparency = trans
  1050.     Texture1.Face = Enum.NormalId.Top
  1051.     Texture1.StudsPerTileU = size
  1052.     Texture1.StudsPerTileV = size
  1053.     Texture2.Parent = gapple
  1054.     Texture2.Texture = "rbxassetid://4771489612"
  1055.     Texture2.Transparency = trans
  1056.     Texture2.Face = Enum.NormalId.Back
  1057.     Texture2.StudsPerTileU = size
  1058.     Texture2.StudsPerTileV = size
  1059.     Texture3.Parent = gapple
  1060.     Texture3.Texture = "rbxassetid://4771489612"
  1061.     Texture3.Transparency = trans
  1062.     Texture3.Face = Enum.NormalId.Front
  1063.     Texture3.StudsPerTileU = size
  1064.     Texture3.StudsPerTileV = size
  1065.     Texture4.Parent = gapple
  1066.     Texture4.Texture = "rbxassetid://4771489612"
  1067.     Texture4.Transparency = trans
  1068.     Texture4.Face = Enum.NormalId.Left
  1069.     Texture4.StudsPerTileU = size
  1070.     Texture4.StudsPerTileV = size
  1071.     Texture5.Parent = gapple
  1072.     Texture5.Texture = "rbxassetid://4771489612"
  1073.     Texture5.Transparency = trans
  1074.     Texture5.Face = Enum.NormalId.Right
  1075.     Texture5.StudsPerTileU = size
  1076.     Texture5.StudsPerTileV = size
  1077.     spawn(function()
  1078.         local c
  1079.         c = game:GetService("RunService").Stepped:Connect(function()
  1080.             if not char or not torso or not hum or 0 >= hum.Health then
  1081.                 c:Disconnect();
  1082.             end;
  1083.             Texture0.OffsetStudsU = Texture0.OffsetStudsU + speed
  1084.             Texture1.OffsetStudsU = Texture1.OffsetStudsU + speed
  1085.             Texture2.OffsetStudsU = Texture2.OffsetStudsU + speed
  1086.             Texture3.OffsetStudsU = Texture3.OffsetStudsU + speed
  1087.             Texture4.OffsetStudsU = Texture4.OffsetStudsU + speed
  1088.             Texture5.OffsetStudsU = Texture5.OffsetStudsU + speed
  1089.         end)
  1090.     end)
  1091.    
  1092.     local left = Instance.new("IntValue")
  1093.     local lasteatid = 0
  1094.    
  1095.     left.Name = 'left'
  1096.     left.Parent = gappletool
  1097.     left.Value = 1/0
  1098.    
  1099.     local eatsound = Instance.new("Sound")
  1100.     eatsound.SoundId = 'rbxassetid://3389702715'
  1101.     eatsound.Volume = 1
  1102.     eatsound.Parent = gapple
  1103.     local eatsound2 = Instance.new("Sound")
  1104.     eatsound2.SoundId = 'rbxassetid://3389703911'
  1105.     eatsound2.Volume = 1
  1106.     eatsound2.Parent = gapple
  1107.     local eatsound3 = Instance.new("Sound")
  1108.     eatsound3.SoundId = 'rbxassetid://3389705190'
  1109.     eatsound3.Volume = 1
  1110.     eatsound3.Parent = gapple
  1111.     local burpsound = Instance.new("Sound")
  1112.     burpsound.SoundId = 'rbxassetid://3362384054'
  1113.     burpsound.Volume = 1
  1114.     burpsound.Parent = gapple
  1115.    
  1116.     local using = false
  1117.    
  1118.     local function eat()
  1119.         local ate = false
  1120.         local can_eat = true
  1121.         local eatsid = 1
  1122.         spawn(function()
  1123.             while not ate do
  1124.                 game:GetService("TweenService"):Create(gappletool,TweenInfo.new(0.2),{Grip = CFrame.new(0.444913447, -0.884199917, 1.49106276, -0.00188598502, 0.511175215, -0.859474421, 0.000825672294, 0.859476447, 0.511174619, 0.999997914, 0.000254422426, -0.00204300135)}):Play()
  1125.                 wait(0.1)
  1126.                 game:GetService("TweenService"):Create(gappletool,TweenInfo.new(0.2),{Grip = CFrame.new(0.55410701, -0.758452654, 1.49106288, -0.00188598502, 0.511175215, -0.859474421, 0.000825672294, 0.859476447, 0.511174619, 0.999997914, 0.000254422426, -0.00204300135)}):Play()
  1127.                 wait(0.1)
  1128.             end
  1129.             game:GetService("TweenService"):Create(gappletool,TweenInfo.new(0.2),{Grip = CFrame.new(0.194969162, -0.202951327, 0, 1, 0, -1.74845553e-07, 2.16089315e-08, 0.992333531, 0.123588681, 1.735051e-07, -0.123588681, 0.992333531)}):Play()
  1130.         end)
  1131.         spawn(function()
  1132.             while not ate do
  1133.                 if gappletool.Parent ~= char then
  1134.                     can_eat = false
  1135.                     ate = true;
  1136.                     using = false;
  1137.                     return
  1138.                 end
  1139.                 eatsid = math.random(1,3)
  1140.                 if eatsid == lasteatid then
  1141.                     eatsid = eatsid + 1
  1142.                 elseif eatsid == lasteatid and eatsid == 3 then
  1143.                     eatsid = 1
  1144.                 end
  1145.                 lasteatid = eatsid
  1146.                 if eatsid == 1 then
  1147.                     eatsound:Play()
  1148.                     wait(eatsound.TimeLength-0.1)
  1149.                     elseif eatsid == 2 then
  1150.                     eatsound2:Play()
  1151.                     wait(eatsound2.TimeLength-0.1)
  1152.                     elseif eatsid == 3 then
  1153.                     eatsound3:Play()
  1154.                     wait(eatsound3.TimeLength-0.1)
  1155.                 end
  1156.             end
  1157.         end)
  1158.         wait(1.5)
  1159.         if gappletool.Parent == char and can_eat then else return; end;
  1160.         burpsound:Play()
  1161.         ate = true
  1162.         using = false;
  1163.         --left.Value = left.Value - 1
  1164.         --gappletool.ToolTip = "Left: " .. left.Value
  1165.         effect2(char,hum,torso,80,20)
  1166.         wait(0.2)
  1167.         --[[
  1168.         if 0 >= left.Value then
  1169.             gappletool:Destroy()
  1170.         end
  1171.         ]]
  1172.     end
  1173.    
  1174.     local gappleremote = Instance.new("RemoteEvent");
  1175.     gappleremote.Name = 'gappleremote';
  1176.     gappleremote.Parent = char;
  1177.    
  1178.     gappleremote.OnServerEvent:Connect(function(lplr)
  1179.         if plr == lplr then
  1180.             if gappletool.Parent == char and not using --[[and left.Value > 0]] then
  1181.                 using = true
  1182.                 spawn(function() eat() end)
  1183.             end
  1184.         end
  1185.     end)
  1186.    
  1187.     local lscode = [[
  1188.         local plr = game:GetService("Players").LocalPlayer;
  1189.         local mouse = plr:GetMouse();
  1190.         local gappleremote = script.Parent;
  1191.        
  1192.         mouse.Button1Down:Connect(function()
  1193.             gappleremote:FireServer();
  1194.         end);
  1195.     ]]
  1196.    
  1197.     NLS(lscode,gappleremote);
  1198. end
  1199.  
  1200. spawntotem()
  1201. spawngapple()
  1202. spawn_crystal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement