KrYn0MoRe

end crystal

Jun 23rd, 2020 (edited)
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.64 KB | None | 0 0
  1. local lfx = false
  2. local crystals = {}
  3. local base_speed = 0.02;
  4. local speed1,speed2,speed3 = base_speed/2,base_speed/1.2,base_speed/1.5;
  5. local d = 20;
  6. local up = 1
  7. game:GetService("RunService").Heartbeat:Connect(function()
  8.     for i,v in pairs(crystals) do
  9.         if v.p1 then
  10.             local p1,p2,p3,pos = v.p1,v.p2,v.p3,v.pos
  11.             if not v.sine then
  12.                 v.sine = 0
  13.                 --v.pos = v.pos + Vector3.new(0,up/2,0)
  14.             end
  15.             v.sine = v.sine+1
  16.             p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(0,speed2,speed2);
  17.             p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(0,speed1,speed1);
  18.             p3.CFrame = p3.CFrame*CFrame.fromEulerAnglesXYZ(speed3,speed3,0);
  19.             p1.Position = pos+Vector3.new(0,up*math.cos(v.sine/d),0);
  20.             p2.Position = pos+Vector3.new(0,up*math.cos(v.sine/d),0);
  21.             p3.Position = pos+Vector3.new(0,up*math.cos(v.sine/d),0);
  22.         else
  23.             table.remove(crystals,i)
  24.         end
  25.     end
  26. end)
  27.  
  28. local plr = owner;
  29. local char = plr.Character;
  30. local hum = char:FindFirstChildOfClass("Humanoid");
  31. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart");
  32.  
  33. local partfolder = Instance.new("Folder");
  34. partfolder.Parent = script;
  35. partfolder.Name = 'partfolder';
  36.  
  37. local debris = game:GetService("Debris");
  38. local tween = game:GetService("TweenService");
  39.  
  40. local explosionstimepos = {0,4,8,12,16};
  41. local maintimepos = 1;
  42. local used = 0
  43.  
  44. local function createcrystal(pos)
  45.     local Model0 = Instance.new("Model");
  46.     local Part1 = Instance.new("Part");
  47.     local Part4 = Instance.new("Part");
  48.     local Part6 = Instance.new("Part");
  49.     local Part69 = Instance.new("Part");
  50.     Model0.Name = "End Crystal";
  51.     Model0.Parent = partfolder;
  52.     Part1.Name = "Outside";
  53.     Part1.Parent = Model0;
  54.     Part1.Orientation = Vector3.new(0, 45, 0);
  55.     Part1.Position = pos+Vector3.new(0,0.5,0);
  56.     Part1.Rotation = Vector3.new(0, 45, 0);
  57.     Part1.Color = Color3.new(0.666667, 0, 0.666667);
  58.     Part1.Material = Enum.Material.Fabric;
  59.     Part1.Transparency = 1;
  60.     Part1.Size = Vector3.new(3.5, 3.5, 3.5);
  61.     Part1.Anchored = true;
  62.     Part1.BottomSurface = Enum.SurfaceType.Smooth;
  63.     Part1.BrickColor = BrickColor.new("Magenta");
  64.     Part1.CanCollide = false;
  65.     Part1.TopSurface = Enum.SurfaceType.Smooth;
  66.     Part1.brickColor = BrickColor.new("Magenta");
  67.     Part69.Name = "HumanoidRootPart";
  68.     Part69.Parent = Model0;
  69.     Part69.Orientation = Vector3.new(0, 45, 0);
  70.     Part69.Position = pos-Vector3.new(0,4.3,0);
  71.     Part69.Rotation = Vector3.new(0, 45, 0);
  72.     Part69.Material = Enum.Material.Concrete;
  73.     Part69.Color = Color3.new(0, 0, 0);
  74.     Part69.Transparency = 1;
  75.     Part69.Size = Vector3.new(0.05, 0.5, 0.05);
  76.     Part69.Anchored = true;
  77.     Part69.CanCollide = false;
  78.     Part4.Name = "Torso";
  79.     Part4.Parent = Model0;
  80.     Part4.Orientation = Vector3.new(45, 0, 0);
  81.     Part4.Position = pos+Vector3.new(0,0.5,0);
  82.     Part4.Rotation = Vector3.new(45, 0, 0);
  83.     Part4.Color = Color3.new(0.666667, 0, 0.666667);
  84.     Part4.Material = Enum.Material.Fabric;
  85.     Part4.Transparency = 1;
  86.     Part4.Size = Vector3.new(3.2, 3.2, 3.2);
  87.     Part4.Anchored = true;
  88.     Part4.BottomSurface = Enum.SurfaceType.Smooth;
  89.     Part4.BrickColor = BrickColor.new("Magenta");
  90.     Part4.CanCollide = false;
  91.     Part4.TopSurface = Enum.SurfaceType.Smooth;
  92.     Part4.brickColor = BrickColor.new("Magenta");
  93.     Part6.Name = "Head";
  94.     Part6.Parent = Model0;
  95.     Part6.Orientation = Vector3.new(45, 0, 0);
  96.     Part6.Position = pos+Vector3.new(0,0.5,0);
  97.     Part6.Rotation = Vector3.new(45, 0, 0);
  98.     Part6.Color = Color3.new(0.666667, 0, 0.666667);
  99.     Part6.Size = Vector3.new(2.5, 2.5, 2.5);
  100.     Part6.Anchored = true;
  101.     Part6.BottomSurface = Enum.SurfaceType.Smooth;
  102.     Part6.BrickColor = BrickColor.new("Magenta");
  103.     Part6.CanCollide = false;
  104.     Part6.Material = Enum.Material.Fabric;
  105.     Part6.TopSurface = Enum.SurfaceType.Smooth;
  106.     Part6.brickColor = BrickColor.new("Magenta");
  107.        
  108.     if not lfx then
  109.     spawn(function()
  110.         local Decal0 = Instance.new("Decal");
  111.         local Decal1 = Instance.new("Decal");
  112.         local Decal2 = Instance.new("Decal");
  113.         local Decal3 = Instance.new("Decal");
  114.         local Decal4 = Instance.new("Decal");
  115.         local Decal5 = Instance.new("Decal");
  116.         Decal0.Parent = Part6;
  117.         Decal0.Texture = "http://www.roblox.com/asset/?id=4671609130";
  118.         Decal0.Face = Enum.NormalId.Left;
  119.         Decal1.Parent = Part6;
  120.         Decal1.Texture = "http://www.roblox.com/asset/?id=4671609130";
  121.         Decal1.Face = Enum.NormalId.Top;
  122.         Decal2.Parent = Part6;
  123.         Decal2.Texture = "http://www.roblox.com/asset/?id=4671609130";
  124.         Decal2.Face = Enum.NormalId.Right;
  125.         Decal3.Parent = Part6;
  126.         Decal3.Texture = "http://www.roblox.com/asset/?id=4671609130";
  127.         Decal3.Face = Enum.NormalId.Bottom;
  128.         Decal4.Parent = Part6;
  129.         Decal4.Texture = "http://www.roblox.com/asset/?id=4671609130";
  130.         Decal4.Face = Enum.NormalId.Back;
  131.         Decal5.Parent = Part6;
  132.         Decal5.Texture = "http://www.roblox.com/asset/?id=4671609130";
  133.     end);
  134.    
  135.     spawn(function()
  136.         local Decal0 = Instance.new("Decal");
  137.         local Decal1 = Instance.new("Decal");
  138.         local Decal2 = Instance.new("Decal");
  139.         local Decal3 = Instance.new("Decal");
  140.         local Decal4 = Instance.new("Decal");
  141.         local Decal5 = Instance.new("Decal");
  142.         Decal0.Parent = Part4;
  143.         Decal0.Texture = "http://www.roblox.com/asset/?id=4671588152";
  144.         Decal0.Face = Enum.NormalId.Left;
  145.         Decal1.Parent = Part4;
  146.         Decal1.Texture = "http://www.roblox.com/asset/?id=4671588152";
  147.         Decal1.Face = Enum.NormalId.Top;
  148.         Decal2.Parent = Part4;
  149.         Decal2.Texture = "http://www.roblox.com/asset/?id=4671588152";
  150.         Decal2.Face = Enum.NormalId.Right;
  151.         Decal3.Parent = Part4;
  152.         Decal3.Texture = "http://www.roblox.com/asset/?id=4671588152"
  153.         Decal3.Face = Enum.NormalId.Bottom;
  154.         Decal4.Parent = Part4;
  155.         Decal4.Texture = "http://www.roblox.com/asset/?id=4671588152";
  156.         Decal4.Face = Enum.NormalId.Back;
  157.         Decal5.Parent = Part4;
  158.         Decal5.Texture = "http://www.roblox.com/asset/?id=4671588152";
  159.     end);
  160.    
  161.     spawn(function()
  162.         local Decal0 = Instance.new("Decal");
  163.         local Decal1 = Instance.new("Decal");
  164.         local Decal2 = Instance.new("Decal");
  165.         local Decal3 = Instance.new("Decal");
  166.         local Decal4 = Instance.new("Decal");
  167.         local Decal5 = Instance.new("Decal");
  168.         Decal0.Parent = Part1;
  169.         Decal0.Texture = "http://www.roblox.com/asset/?id=4671588152";
  170.         Decal0.Face = Enum.NormalId.Left;
  171.         Decal1.Parent = Part1;
  172.         Decal1.Texture = "http://www.roblox.com/asset/?id=4671588152";
  173.         Decal1.Face = Enum.NormalId.Top;
  174.         Decal2.Parent = Part1;
  175.         Decal2.Texture = "http://www.roblox.com/asset/?id=4671588152";
  176.         Decal2.Face = Enum.NormalId.Right;
  177.         Decal3.Parent = Part1;
  178.         Decal3.Texture = "http://www.roblox.com/asset/?id=4671588152";
  179.         Decal3.Face = Enum.NormalId.Bottom;
  180.         Decal4.Parent = Part1;
  181.         Decal4.Texture = "http://www.roblox.com/asset/?id=4671588152";
  182.         Decal4.Face = Enum.NormalId.Back;
  183.         Decal5.Parent = Part1;
  184.         Decal5.Texture = "http://www.roblox.com/asset/?id=4671588152";
  185.             end);
  186.     else
  187.         Part1.Transparency = 0.7
  188.         Part6.Transparency = 0
  189.         Part4.Transparency = 0.7
  190.     end
  191.    
  192.     local p1,p2,p3,main,model = Part1,Part4,Part6,Part69,Model0;
  193.    
  194.     p1.Locked = true;
  195.     p2.Locked = true;
  196.     p3.Locked = true;
  197.     main.Locked = true;
  198.    
  199.     local exploded = false;
  200.    
  201.     local bvalue = Instance.new("BoolValue");
  202.     bvalue.Parent = model;
  203.     bvalue.Name = 'end crystal explode';
  204.  
  205.     local cvalue = Instance.new("BoolValue");
  206.     cvalue.Parent = model;
  207.     cvalue.Name = 'end crystal chain activated';
  208.    
  209.     workspace.DescendantAdded:Connect(function(obj)
  210.         if obj:IsA("Explosion") then
  211.             obj.Hit:Connect(function(hit)
  212.                 local par = hit.Parent;
  213.                 if par then
  214.                     local c = par:FindFirstChild('end crystal explode');
  215.                     if c and c:IsA("BoolValue") then
  216.                         c.Value = true;
  217.                     end;
  218.                 else
  219.                     return;
  220.                 end;
  221.             end);
  222.         end;
  223.     end);
  224.  
  225.     for i,v in pairs(model:GetDescendants()) do
  226.         if v:IsA("BasePart") and v ~= main then
  227.             local click = Instance.new("ClickDetector");
  228.             click.MaxActivationDistance = 40;
  229.             click.CursorIcon = 'rbxassetid://93681360';
  230.             click.Parent = v;
  231.        
  232.             click.MouseClick:Connect(function()
  233.                 click:Destroy();
  234.                 bvalue.Value = true;
  235.             end);
  236.         end;
  237.     end;
  238.    
  239.     local function explode(par,poss)
  240.         exploded = true;
  241.         bvalue.Value = true;
  242.         p1:Destroy();p2:Destroy();p3:Destroy();main:Destroy();
  243.         local Part0 = Instance.new("Part");
  244.         Part0.Name = "grenade";
  245.         Part0.Parent = par;
  246.         Part0.Position = poss;
  247.         Part0.Transparency = 1;
  248.         Part0.Size = Vector3.new(4, 0.0500000007, 4);
  249.         Part0.Anchored = true;
  250.         Part0.BottomSurface = Enum.SurfaceType.Smooth;
  251.         Part0.CanCollide = false;
  252.         Part0.Locked = true;
  253.         Part0.TopSurface = Enum.SurfaceType.Smooth;
  254.         local ParticleEmitter1 = Instance.new("ParticleEmitter");
  255.         ParticleEmitter1.Parent = Part0;
  256.         ParticleEmitter1.Speed = NumberRange.new(25,30);
  257.         ParticleEmitter1.Color = ColorSequence.new(Color3.new(1,1,1),Color3.new(1,1,1));
  258.         ParticleEmitter1.Enabled = false;
  259.         ParticleEmitter1.LightEmission = 0.80000001192093;
  260.         ParticleEmitter1.Texture = "rbxassetid://3607612871";
  261.         ParticleEmitter1.Size = NumberSequence.new(3,0.5);
  262.         ParticleEmitter1.Lifetime = NumberRange.new(0.80000001192093, 0.80000001192093);
  263.         ParticleEmitter1.LockedToPart = true;
  264.         ParticleEmitter1.Rate = 10000;
  265.         ParticleEmitter1.RotSpeed = NumberRange.new(270, 270);
  266.         ParticleEmitter1.SpreadAngle = Vector2.new(-90, -90);
  267.         ParticleEmitter1.VelocitySpread = -90;
  268.         if cvalue.Value == false then
  269.             local selectedtimepos = maintimepos + 1;
  270.             if selectedtimepos > #explosionstimepos then
  271.                 selectedtimepos = 1;
  272.             end;
  273.             maintimepos = selectedtimepos;
  274.             local s = Instance.new("Sound");
  275.             s.Parent = Part0;
  276.             s.SoundId = "rbxassetid://4673732522";
  277.             s.Volume = 4;
  278.             s.PlaybackSpeed = math.random(10,11)/10;
  279.             s.TimePosition = explosionstimepos[math.random(1,#explosionstimepos)];
  280.             s:Play();
  281.             game:GetService("Debris"):AddItem(s,3.9);
  282.         end;
  283.         used = used + 1
  284.         local maxdist = 30
  285.         local ex = Instance.new("Explosion");
  286.         ex.Visible = false;
  287.         ex.Position = poss;
  288.         ex.BlastRadius = maxdist;
  289.         ex.BlastPressure = 100000;
  290.         ex.DestroyJointRadiusPercent = 0;
  291.         ex.ExplosionType = Enum.ExplosionType.NoCraters;
  292.         ex.Parent = Part0;
  293.         ex.Hit:connect(function(obj, dist)
  294.             if maxdist >= dist and obj ~= Part0 then
  295.                 local targchar,targhum,targtorso,targhead,targleg1,targleg2,targarm1,targarm2,confirm;
  296.                 pcall(function()
  297.                     targchar = obj.Parent;
  298.                 end);
  299.                 pcall(function()
  300.                     targhum = targchar:FindFirstChildOfClass("Humanoid");
  301.                 end);
  302.                 pcall(function()
  303.                     targtorso = targchar:FindFirstChild("HumanoidRootPart") or targchar:FindFirstChild("Torso");
  304.                 end);
  305.                 pcall(function()
  306.                     targhead = targchar:FindFirstChild("Head");
  307.                 end);
  308.                 pcall(function()
  309.                     targleg1 = targchar:FindFirstChild("Left Leg") or targchar:FindFirstChild("LeftUpperLeg");
  310.                 end);
  311.                 pcall(function()
  312.                     targleg2 = targchar:FindFirstChild("Right Leg") or targchar:FindFirstChild("RightUpperLeg");
  313.                 end);
  314.                 pcall(function()
  315.                     targarm1 = targchar:FindFirstChild("Left Arm") or targchar:FindFirstChild("LeftUpperArm");
  316.                 end);
  317.                 pcall(function()
  318.                     targarm2 = targchar:FindFirstChild("Right Arm") or targchar:FindFirstChild("RightUpperArm");
  319.                 end);
  320.                 pcall(function()
  321.                     confirm = targhum:FindFirstChild('hit by ' .. plr.name);
  322.                 end);
  323.                 local par = obj.Parent;
  324.                 if par then
  325.                     local c = par:FindFirstChild('end crystal chain activated');
  326.                     if c and c:IsA("BoolValue") then
  327.                         c.Value = true;
  328.                     end;
  329.                 else
  330.                     return;
  331.                 end;
  332.                 if targchar and targhum and targtorso and targhead and targleg1 and targleg2 and targarm1 and targarm2 and not confirm then
  333.                     local ec_dmg = 500
  334.                     local remove = 100
  335.                     local l1,l2
  336.                     l1 = 48.5
  337.                     l2 = (100-(l1*2))/4
  338.                     local ignore = {partfolder,Part0, targchar};
  339.                     for i,v in ipairs(game:GetService("Players"):GetPlayers()) do
  340.                         if v and v.Character then
  341.                             table.insert(ignore,1,v.Character);
  342.                         end;
  343.                     end;
  344.                     local ray1 = Ray.new(poss, (targtorso.Position-poss));
  345.                     local hit1 = workspace:FindPartOnRayWithIgnoreList(ray1,ignore,false,true);
  346.                     if hit1 then
  347.                         remove = remove - l2;
  348.                     end;
  349.                     local ray2 = Ray.new(poss, (targleg1.Position-poss));
  350.                     local hit2 = workspace:FindPartOnRayWithIgnoreList(ray2,ignore,false,true);
  351.                     if hit2 then
  352.                         remove = remove - l1;
  353.                     end;
  354.                     local ray3 = Ray.new(poss, (targleg2.Position-poss));
  355.                     local hit3 = workspace:FindPartOnRayWithIgnoreList(ray3,ignore,false,true);
  356.                     if hit3 then
  357.                         remove = remove - l1;
  358.                     end;
  359.                     local ray4 = Ray.new(poss, (targhead.Position-poss));
  360.                     local hit4 = workspace:FindPartOnRayWithIgnoreList(ray4,ignore,false,true);
  361.                     if hit4 then
  362.                         remove = remove - l2;
  363.                     end;
  364.                     local ray5 = Ray.new(poss, (targarm1.Position-poss));
  365.                     local hit5 = workspace:FindPartOnRayWithIgnoreList(ray5,ignore,false,true);
  366.                     if hit5 then
  367.                         remove = remove - l2;
  368.                     end;
  369.                     local ray6 = Ray.new(poss, (targarm2.Position-poss));
  370.                     local hit6 = workspace:FindPartOnRayWithIgnoreList(ray6,ignore,false,true);
  371.                     if hit6 then
  372.                         remove = remove - l2;
  373.                     end;
  374.                     print(remove)
  375.                     ec_dmg = ec_dmg*(remove/100)
  376.                     ec_dmg = ec_dmg*((maxdist-dist)/maxdist)
  377.                     local confirm = Instance.new("IntValue");
  378.                     confirm.Name = 'hit by ' .. plr.name
  379.                     confirm.Parent = targhum;
  380.                     game:GetService("Debris"):AddItem(confirm,0.5);
  381.                     print('dmg for ' .. targchar.Name .. '; ' .. ec_dmg)
  382.                     targhum:TakeDamage(ec_dmg);
  383.                 end;
  384.             end;
  385.         end);
  386.         spawn(function()
  387.             ParticleEmitter1.Enabled = true;
  388.             wait(.25);
  389.             ParticleEmitter1.Enabled = false;
  390.             debris:AddItem(Part0,2);
  391.             debris:AddItem(ex,2);
  392.         end);
  393.     end;
  394.  
  395.     local humanoid = Instance.new("Humanoid")
  396.     humanoid.Parent = model
  397.     humanoid.MaxHealth = 1
  398.     humanoid.Health = 1
  399.     humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  400.     humanoid.HealthDisplayDistance = Enum.HumanoidHealthDisplayType.AlwaysOff
  401.     humanoid.HealthChanged:Connect(function()
  402.         if bvalue.Value == true and not exploded then
  403.             explode(workspace,main.Position);
  404.         end;
  405.     end)
  406.    
  407.     bvalue.Changed:Connect(function()
  408.         if bvalue.Value == true and not exploded then
  409.             explode(workspace,main.Position);
  410.         end;
  411.     end);
  412.    
  413.     Model0.ChildRemoved:Connect(function()
  414.         if bvalue.Value == true and not exploded then
  415.             explode(workspace,main.Position);
  416.         end;
  417.     end);
  418.    
  419.     local base_speed = 0.025;
  420.     local speed1,speed2,speed3 = base_speed/2,base_speed/3,base_speed/1.5;
  421.     p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(45,0,0);
  422.     p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(45,0,0);
  423.     table.insert(crystals,#crystals+1,{p1 = p1,p2 = p2,p3 = p3,pos = p1.Position})
  424. end;
  425.  
  426. local function CheckIfAlive()
  427.     local alive = false;
  428.     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
  429.         alive = true;
  430.     end;
  431.     return alive;
  432. end;
  433.  
  434. local equipped = false;
  435.  
  436. local tool = Instance.new("Tool");
  437. local handle = Instance.new("Part");
  438. local Decal2 = Instance.new("Decal");
  439. local Decal3 = Instance.new("Decal");
  440. tool.Name = "End Crystal";
  441. tool.Parent = plr['Backpack'];
  442. tool.TextureId = "rbxassetid://4124593233";
  443. 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);
  444. tool.ToolTip = "Keep cautious! Flammable!";
  445. tool.CanBeDropped = false;
  446. handle.Name = "Handle";
  447. handle.Parent = tool;
  448. handle.CFrame = CFrame.new(-87.6886597, 2.380023, 164.558884, 1, 0, 0, 0, 1, 0, 0, 0, 1);
  449. handle.Position = Vector3.new(-87.6886597, 2.380023, 164.558884);
  450. handle.Transparency = 1;
  451. handle.Size = Vector3.new(0.05, 2, 2);
  452. handle.BottomSurface = Enum.SurfaceType.Smooth;
  453. handle.CanCollide = true;
  454. handle.Massless = true;
  455. handle.Anchored = false;
  456. handle.TopSurface = Enum.SurfaceType.Smooth;
  457. Decal2.Parent = handle;
  458. Decal2.Texture = "rbxassetid://4124593233";
  459. Decal2.Face = Enum.NormalId.Right;
  460. Decal3.Parent = handle;
  461. Decal3.Texture = "rbxassetid://4124593233";
  462. Decal3.Face = Enum.NormalId.Left;
  463.  
  464. tool.Equipped:Connect(function()
  465.     char = tool.Parent;
  466.     plr = game:GetService("Players"):GetPlayerFromCharacter(char);
  467.     hum = char:FindFirstChildOfClass("Humanoid");
  468.     torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart");
  469.     if not CheckIfAlive() then tool.Parent = nil return end;
  470.     equipped = true;
  471. end);
  472.  
  473. tool.Unequipped:Connect(function()
  474.     equipped = false;
  475. end);
  476.  
  477. local crystalremote = Instance.new("RemoteEvent");
  478. crystalremote.Name = 'crystalremote';
  479. crystalremote.Parent = char;
  480.  
  481. local lscode = [[
  482.     local plr = game:GetService("Players").LocalPlayer;
  483.     local mouse = plr:GetMouse();
  484.     local crystalremote = script.Parent;
  485.    
  486.     mouse.Button1Down:Connect(function()
  487.         local mpos = mouse.hit.p;
  488.         crystalremote:FireServer(1,mpos);
  489.     end);
  490. ]]
  491. --[[ ^^
  492.     mouse.KeyDown:Connect(function(key)
  493.         local targ = mouse.Target;
  494.         if key == 'e' and targ then
  495.             pcall(function()
  496.                 local par = targ.Parent;
  497.                 if par then
  498.                     local c = par:FindFirstChild('end crystal explode');
  499.                     if c and c:IsA("BoolValue") then
  500.                         --c.Value = true;
  501.                         crystalremote:FireServer(2,c,targ);
  502.                     end;
  503.                 else
  504.                     return;
  505.                 end;
  506.             end);
  507.         end;
  508.     end);
  509. --]]
  510.  
  511. NLS(lscode,crystalremote);
  512. local chitanimid = 0;
  513. local cooldown = false
  514.  
  515. crystalremote.OnServerEvent:Connect(function(plr,mode,data,data2)
  516.     if mode == 1 and data and CheckIfAlive() and equipped then
  517.         if not cooldown then else return end
  518.         cooldown = true
  519.         spawn(function()
  520.             chitanimid = 1;
  521.             if chitanimid == 1 then else return end
  522.             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();
  523.             chitanimid = 2;
  524.             wait(0.08);
  525.             if chitanimid == 2 then else return end
  526.             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();
  527.             chitanimid = 3;
  528.             wait(0.04);
  529.             if chitanimid == 3 then else return end
  530.             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();
  531.         end)
  532.         createcrystal(data+Vector3.new(0,4,0));
  533.         wait(0.1)
  534.         cooldown = false
  535.     elseif mode == 2 and data and data2 then
  536.         pcall(function()
  537.             local dist = (torso.Position - data2.Position).Magnitude
  538.             if 30 >= dist then else return end
  539.             data.Value = true;
  540.         end);
  541.     end;
  542. end);
Add Comment
Please, Sign In to add comment