Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lfx = false
- local crystals = {}
- local base_speed = 0.02;
- local speed1,speed2,speed3 = base_speed/2,base_speed/1.2,base_speed/1.5;
- local d = 20;
- local up = 1
- game:GetService("RunService").Heartbeat:Connect(function()
- for i,v in pairs(crystals) do
- if v.p1 then
- local p1,p2,p3,pos = v.p1,v.p2,v.p3,v.pos
- if not v.sine then
- v.sine = 0
- --v.pos = v.pos + Vector3.new(0,up/2,0)
- end
- v.sine = v.sine+1
- p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(0,speed2,speed2);
- p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(0,speed1,speed1);
- p3.CFrame = p3.CFrame*CFrame.fromEulerAnglesXYZ(speed3,speed3,0);
- p1.Position = pos+Vector3.new(0,up*math.cos(v.sine/d),0);
- p2.Position = pos+Vector3.new(0,up*math.cos(v.sine/d),0);
- p3.Position = pos+Vector3.new(0,up*math.cos(v.sine/d),0);
- else
- table.remove(crystals,i)
- end
- end
- end)
- local plr = owner;
- local char = plr.Character;
- local hum = char:FindFirstChildOfClass("Humanoid");
- local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart");
- local partfolder = Instance.new("Folder");
- partfolder.Parent = script;
- partfolder.Name = 'partfolder';
- local debris = game:GetService("Debris");
- local tween = game:GetService("TweenService");
- local explosionstimepos = {0,4,8,12,16};
- local maintimepos = 1;
- local used = 0
- local function createcrystal(pos)
- local Model0 = Instance.new("Model");
- local Part1 = Instance.new("Part");
- local Part4 = Instance.new("Part");
- local Part6 = Instance.new("Part");
- local Part69 = Instance.new("Part");
- Model0.Name = "End Crystal";
- Model0.Parent = partfolder;
- Part1.Name = "Outside";
- Part1.Parent = Model0;
- Part1.Orientation = Vector3.new(0, 45, 0);
- Part1.Position = pos+Vector3.new(0,0.5,0);
- Part1.Rotation = Vector3.new(0, 45, 0);
- Part1.Color = Color3.new(0.666667, 0, 0.666667);
- Part1.Material = Enum.Material.Fabric;
- Part1.Transparency = 1;
- Part1.Size = Vector3.new(3.5, 3.5, 3.5);
- Part1.Anchored = true;
- Part1.BottomSurface = Enum.SurfaceType.Smooth;
- Part1.BrickColor = BrickColor.new("Magenta");
- Part1.CanCollide = false;
- Part1.TopSurface = Enum.SurfaceType.Smooth;
- Part1.brickColor = BrickColor.new("Magenta");
- Part69.Name = "HumanoidRootPart";
- Part69.Parent = Model0;
- Part69.Orientation = Vector3.new(0, 45, 0);
- Part69.Position = pos-Vector3.new(0,4.3,0);
- Part69.Rotation = Vector3.new(0, 45, 0);
- Part69.Material = Enum.Material.Concrete;
- Part69.Color = Color3.new(0, 0, 0);
- Part69.Transparency = 1;
- Part69.Size = Vector3.new(0.05, 0.5, 0.05);
- Part69.Anchored = true;
- Part69.CanCollide = false;
- Part4.Name = "Torso";
- Part4.Parent = Model0;
- Part4.Orientation = Vector3.new(45, 0, 0);
- Part4.Position = pos+Vector3.new(0,0.5,0);
- Part4.Rotation = Vector3.new(45, 0, 0);
- Part4.Color = Color3.new(0.666667, 0, 0.666667);
- Part4.Material = Enum.Material.Fabric;
- Part4.Transparency = 1;
- Part4.Size = Vector3.new(3.2, 3.2, 3.2);
- Part4.Anchored = true;
- Part4.BottomSurface = Enum.SurfaceType.Smooth;
- Part4.BrickColor = BrickColor.new("Magenta");
- Part4.CanCollide = false;
- Part4.TopSurface = Enum.SurfaceType.Smooth;
- Part4.brickColor = BrickColor.new("Magenta");
- Part6.Name = "Head";
- Part6.Parent = Model0;
- Part6.Orientation = Vector3.new(45, 0, 0);
- Part6.Position = pos+Vector3.new(0,0.5,0);
- Part6.Rotation = Vector3.new(45, 0, 0);
- Part6.Color = Color3.new(0.666667, 0, 0.666667);
- Part6.Size = Vector3.new(2.5, 2.5, 2.5);
- Part6.Anchored = true;
- Part6.BottomSurface = Enum.SurfaceType.Smooth;
- Part6.BrickColor = BrickColor.new("Magenta");
- Part6.CanCollide = false;
- Part6.Material = Enum.Material.Fabric;
- Part6.TopSurface = Enum.SurfaceType.Smooth;
- Part6.brickColor = BrickColor.new("Magenta");
- if not lfx then
- spawn(function()
- local Decal0 = Instance.new("Decal");
- local Decal1 = Instance.new("Decal");
- local Decal2 = Instance.new("Decal");
- local Decal3 = Instance.new("Decal");
- local Decal4 = Instance.new("Decal");
- local Decal5 = Instance.new("Decal");
- Decal0.Parent = Part6;
- Decal0.Texture = "http://www.roblox.com/asset/?id=4671609130";
- Decal0.Face = Enum.NormalId.Left;
- Decal1.Parent = Part6;
- Decal1.Texture = "http://www.roblox.com/asset/?id=4671609130";
- Decal1.Face = Enum.NormalId.Top;
- Decal2.Parent = Part6;
- Decal2.Texture = "http://www.roblox.com/asset/?id=4671609130";
- Decal2.Face = Enum.NormalId.Right;
- Decal3.Parent = Part6;
- Decal3.Texture = "http://www.roblox.com/asset/?id=4671609130";
- Decal3.Face = Enum.NormalId.Bottom;
- Decal4.Parent = Part6;
- Decal4.Texture = "http://www.roblox.com/asset/?id=4671609130";
- Decal4.Face = Enum.NormalId.Back;
- Decal5.Parent = Part6;
- Decal5.Texture = "http://www.roblox.com/asset/?id=4671609130";
- end);
- spawn(function()
- local Decal0 = Instance.new("Decal");
- local Decal1 = Instance.new("Decal");
- local Decal2 = Instance.new("Decal");
- local Decal3 = Instance.new("Decal");
- local Decal4 = Instance.new("Decal");
- local Decal5 = Instance.new("Decal");
- Decal0.Parent = Part4;
- Decal0.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal0.Face = Enum.NormalId.Left;
- Decal1.Parent = Part4;
- Decal1.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal1.Face = Enum.NormalId.Top;
- Decal2.Parent = Part4;
- Decal2.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal2.Face = Enum.NormalId.Right;
- Decal3.Parent = Part4;
- Decal3.Texture = "http://www.roblox.com/asset/?id=4671588152"
- Decal3.Face = Enum.NormalId.Bottom;
- Decal4.Parent = Part4;
- Decal4.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal4.Face = Enum.NormalId.Back;
- Decal5.Parent = Part4;
- Decal5.Texture = "http://www.roblox.com/asset/?id=4671588152";
- end);
- spawn(function()
- local Decal0 = Instance.new("Decal");
- local Decal1 = Instance.new("Decal");
- local Decal2 = Instance.new("Decal");
- local Decal3 = Instance.new("Decal");
- local Decal4 = Instance.new("Decal");
- local Decal5 = Instance.new("Decal");
- Decal0.Parent = Part1;
- Decal0.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal0.Face = Enum.NormalId.Left;
- Decal1.Parent = Part1;
- Decal1.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal1.Face = Enum.NormalId.Top;
- Decal2.Parent = Part1;
- Decal2.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal2.Face = Enum.NormalId.Right;
- Decal3.Parent = Part1;
- Decal3.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal3.Face = Enum.NormalId.Bottom;
- Decal4.Parent = Part1;
- Decal4.Texture = "http://www.roblox.com/asset/?id=4671588152";
- Decal4.Face = Enum.NormalId.Back;
- Decal5.Parent = Part1;
- Decal5.Texture = "http://www.roblox.com/asset/?id=4671588152";
- end);
- else
- Part1.Transparency = 0.7
- Part6.Transparency = 0
- Part4.Transparency = 0.7
- end
- local p1,p2,p3,main,model = Part1,Part4,Part6,Part69,Model0;
- p1.Locked = true;
- p2.Locked = true;
- p3.Locked = true;
- main.Locked = true;
- local exploded = false;
- local bvalue = Instance.new("BoolValue");
- bvalue.Parent = model;
- bvalue.Name = 'end crystal explode';
- local cvalue = Instance.new("BoolValue");
- cvalue.Parent = model;
- cvalue.Name = 'end crystal chain activated';
- workspace.DescendantAdded:Connect(function(obj)
- if obj:IsA("Explosion") then
- obj.Hit:Connect(function(hit)
- local par = hit.Parent;
- if par then
- local c = par:FindFirstChild('end crystal explode');
- if c and c:IsA("BoolValue") then
- c.Value = true;
- end;
- else
- return;
- end;
- end);
- end;
- end);
- for i,v in pairs(model:GetDescendants()) do
- if v:IsA("BasePart") and v ~= main then
- local click = Instance.new("ClickDetector");
- click.MaxActivationDistance = 40;
- click.CursorIcon = 'rbxassetid://93681360';
- click.Parent = v;
- click.MouseClick:Connect(function()
- click:Destroy();
- bvalue.Value = true;
- end);
- end;
- end;
- local function explode(par,poss)
- exploded = true;
- bvalue.Value = true;
- p1:Destroy();p2:Destroy();p3:Destroy();main:Destroy();
- local Part0 = Instance.new("Part");
- Part0.Name = "grenade";
- Part0.Parent = par;
- Part0.Position = poss;
- Part0.Transparency = 1;
- Part0.Size = Vector3.new(4, 0.0500000007, 4);
- Part0.Anchored = true;
- Part0.BottomSurface = Enum.SurfaceType.Smooth;
- Part0.CanCollide = false;
- Part0.Locked = true;
- Part0.TopSurface = Enum.SurfaceType.Smooth;
- local ParticleEmitter1 = Instance.new("ParticleEmitter");
- ParticleEmitter1.Parent = Part0;
- ParticleEmitter1.Speed = NumberRange.new(25,30);
- ParticleEmitter1.Color = ColorSequence.new(Color3.new(1,1,1),Color3.new(1,1,1));
- ParticleEmitter1.Enabled = false;
- ParticleEmitter1.LightEmission = 0.80000001192093;
- ParticleEmitter1.Texture = "rbxassetid://3607612871";
- ParticleEmitter1.Size = NumberSequence.new(3,0.5);
- ParticleEmitter1.Lifetime = NumberRange.new(0.80000001192093, 0.80000001192093);
- ParticleEmitter1.LockedToPart = true;
- ParticleEmitter1.Rate = 10000;
- ParticleEmitter1.RotSpeed = NumberRange.new(270, 270);
- ParticleEmitter1.SpreadAngle = Vector2.new(-90, -90);
- ParticleEmitter1.VelocitySpread = -90;
- if cvalue.Value == false then
- local selectedtimepos = maintimepos + 1;
- if selectedtimepos > #explosionstimepos then
- selectedtimepos = 1;
- end;
- maintimepos = selectedtimepos;
- local s = Instance.new("Sound");
- s.Parent = Part0;
- s.SoundId = "rbxassetid://4673732522";
- s.Volume = 4;
- s.PlaybackSpeed = math.random(10,11)/10;
- s.TimePosition = explosionstimepos[math.random(1,#explosionstimepos)];
- s:Play();
- game:GetService("Debris"):AddItem(s,3.9);
- end;
- used = used + 1
- local maxdist = 30
- local ex = Instance.new("Explosion");
- ex.Visible = false;
- ex.Position = poss;
- ex.BlastRadius = maxdist;
- ex.BlastPressure = 100000;
- ex.DestroyJointRadiusPercent = 0;
- ex.ExplosionType = Enum.ExplosionType.NoCraters;
- ex.Parent = Part0;
- ex.Hit:connect(function(obj, dist)
- if maxdist >= dist and obj ~= Part0 then
- local targchar,targhum,targtorso,targhead,targleg1,targleg2,targarm1,targarm2,confirm;
- pcall(function()
- targchar = obj.Parent;
- end);
- pcall(function()
- targhum = targchar:FindFirstChildOfClass("Humanoid");
- end);
- pcall(function()
- targtorso = targchar:FindFirstChild("HumanoidRootPart") or targchar:FindFirstChild("Torso");
- end);
- pcall(function()
- targhead = targchar:FindFirstChild("Head");
- end);
- pcall(function()
- targleg1 = targchar:FindFirstChild("Left Leg") or targchar:FindFirstChild("LeftUpperLeg");
- end);
- pcall(function()
- targleg2 = targchar:FindFirstChild("Right Leg") or targchar:FindFirstChild("RightUpperLeg");
- end);
- pcall(function()
- targarm1 = targchar:FindFirstChild("Left Arm") or targchar:FindFirstChild("LeftUpperArm");
- end);
- pcall(function()
- targarm2 = targchar:FindFirstChild("Right Arm") or targchar:FindFirstChild("RightUpperArm");
- end);
- pcall(function()
- confirm = targhum:FindFirstChild('hit by ' .. plr.name);
- end);
- local par = obj.Parent;
- if par then
- local c = par:FindFirstChild('end crystal chain activated');
- if c and c:IsA("BoolValue") then
- c.Value = true;
- end;
- else
- return;
- end;
- if targchar and targhum and targtorso and targhead and targleg1 and targleg2 and targarm1 and targarm2 and not confirm then
- local ec_dmg = 500
- local remove = 100
- local l1,l2
- l1 = 48.5
- l2 = (100-(l1*2))/4
- local ignore = {partfolder,Part0, targchar};
- for i,v in ipairs(game:GetService("Players"):GetPlayers()) do
- if v and v.Character then
- table.insert(ignore,1,v.Character);
- end;
- end;
- local ray1 = Ray.new(poss, (targtorso.Position-poss));
- local hit1 = workspace:FindPartOnRayWithIgnoreList(ray1,ignore,false,true);
- if hit1 then
- remove = remove - l2;
- end;
- local ray2 = Ray.new(poss, (targleg1.Position-poss));
- local hit2 = workspace:FindPartOnRayWithIgnoreList(ray2,ignore,false,true);
- if hit2 then
- remove = remove - l1;
- end;
- local ray3 = Ray.new(poss, (targleg2.Position-poss));
- local hit3 = workspace:FindPartOnRayWithIgnoreList(ray3,ignore,false,true);
- if hit3 then
- remove = remove - l1;
- end;
- local ray4 = Ray.new(poss, (targhead.Position-poss));
- local hit4 = workspace:FindPartOnRayWithIgnoreList(ray4,ignore,false,true);
- if hit4 then
- remove = remove - l2;
- end;
- local ray5 = Ray.new(poss, (targarm1.Position-poss));
- local hit5 = workspace:FindPartOnRayWithIgnoreList(ray5,ignore,false,true);
- if hit5 then
- remove = remove - l2;
- end;
- local ray6 = Ray.new(poss, (targarm2.Position-poss));
- local hit6 = workspace:FindPartOnRayWithIgnoreList(ray6,ignore,false,true);
- if hit6 then
- remove = remove - l2;
- end;
- print(remove)
- ec_dmg = ec_dmg*(remove/100)
- ec_dmg = ec_dmg*((maxdist-dist)/maxdist)
- local confirm = Instance.new("IntValue");
- confirm.Name = 'hit by ' .. plr.name
- confirm.Parent = targhum;
- game:GetService("Debris"):AddItem(confirm,0.5);
- print('dmg for ' .. targchar.Name .. '; ' .. ec_dmg)
- targhum:TakeDamage(ec_dmg);
- end;
- end;
- end);
- spawn(function()
- ParticleEmitter1.Enabled = true;
- wait(.25);
- ParticleEmitter1.Enabled = false;
- debris:AddItem(Part0,2);
- debris:AddItem(ex,2);
- end);
- end;
- local humanoid = Instance.new("Humanoid")
- humanoid.Parent = model
- humanoid.MaxHealth = 1
- humanoid.Health = 1
- humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- humanoid.HealthDisplayDistance = Enum.HumanoidHealthDisplayType.AlwaysOff
- humanoid.HealthChanged:Connect(function()
- if bvalue.Value == true and not exploded then
- explode(workspace,main.Position);
- end;
- end)
- bvalue.Changed:Connect(function()
- if bvalue.Value == true and not exploded then
- explode(workspace,main.Position);
- end;
- end);
- Model0.ChildRemoved:Connect(function()
- if bvalue.Value == true and not exploded then
- explode(workspace,main.Position);
- end;
- end);
- local base_speed = 0.025;
- local speed1,speed2,speed3 = base_speed/2,base_speed/3,base_speed/1.5;
- p1.CFrame = p1.CFrame*CFrame.fromEulerAnglesXYZ(45,0,0);
- p2.CFrame = p2.CFrame*CFrame.fromEulerAnglesXYZ(45,0,0);
- table.insert(crystals,#crystals+1,{p1 = p1,p2 = p2,p3 = p3,pos = p1.Position})
- end;
- local function CheckIfAlive()
- local alive = false;
- 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
- alive = true;
- end;
- return alive;
- end;
- local equipped = false;
- local tool = Instance.new("Tool");
- local handle = Instance.new("Part");
- local Decal2 = Instance.new("Decal");
- local Decal3 = Instance.new("Decal");
- tool.Name = "End Crystal";
- tool.Parent = plr['Backpack'];
- tool.TextureId = "rbxassetid://4124593233";
- 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);
- tool.ToolTip = "Keep cautious! Flammable!";
- tool.CanBeDropped = false;
- handle.Name = "Handle";
- handle.Parent = tool;
- handle.CFrame = CFrame.new(-87.6886597, 2.380023, 164.558884, 1, 0, 0, 0, 1, 0, 0, 0, 1);
- handle.Position = Vector3.new(-87.6886597, 2.380023, 164.558884);
- handle.Transparency = 1;
- handle.Size = Vector3.new(0.05, 2, 2);
- handle.BottomSurface = Enum.SurfaceType.Smooth;
- handle.CanCollide = true;
- handle.Massless = true;
- handle.Anchored = false;
- handle.TopSurface = Enum.SurfaceType.Smooth;
- Decal2.Parent = handle;
- Decal2.Texture = "rbxassetid://4124593233";
- Decal2.Face = Enum.NormalId.Right;
- Decal3.Parent = handle;
- Decal3.Texture = "rbxassetid://4124593233";
- Decal3.Face = Enum.NormalId.Left;
- tool.Equipped:Connect(function()
- char = tool.Parent;
- plr = game:GetService("Players"):GetPlayerFromCharacter(char);
- hum = char:FindFirstChildOfClass("Humanoid");
- torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart");
- if not CheckIfAlive() then tool.Parent = nil return end;
- equipped = true;
- end);
- tool.Unequipped:Connect(function()
- equipped = false;
- end);
- local crystalremote = Instance.new("RemoteEvent");
- crystalremote.Name = 'crystalremote';
- crystalremote.Parent = char;
- local lscode = [[
- local plr = game:GetService("Players").LocalPlayer;
- local mouse = plr:GetMouse();
- local crystalremote = script.Parent;
- mouse.Button1Down:Connect(function()
- local mpos = mouse.hit.p;
- crystalremote:FireServer(1,mpos);
- end);
- ]]
- --[[ ^^
- mouse.KeyDown:Connect(function(key)
- local targ = mouse.Target;
- if key == 'e' and targ then
- pcall(function()
- local par = targ.Parent;
- if par then
- local c = par:FindFirstChild('end crystal explode');
- if c and c:IsA("BoolValue") then
- --c.Value = true;
- crystalremote:FireServer(2,c,targ);
- end;
- else
- return;
- end;
- end);
- end;
- end);
- --]]
- NLS(lscode,crystalremote);
- local chitanimid = 0;
- local cooldown = false
- crystalremote.OnServerEvent:Connect(function(plr,mode,data,data2)
- if mode == 1 and data and CheckIfAlive() and equipped then
- if not cooldown then else return end
- cooldown = true
- spawn(function()
- chitanimid = 1;
- if chitanimid == 1 then else return end
- 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();
- chitanimid = 2;
- wait(0.08);
- if chitanimid == 2 then else return end
- 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();
- chitanimid = 3;
- wait(0.04);
- if chitanimid == 3 then else return end
- 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();
- end)
- createcrystal(data+Vector3.new(0,4,0));
- wait(0.1)
- cooldown = false
- elseif mode == 2 and data and data2 then
- pcall(function()
- local dist = (torso.Position - data2.Position).Magnitude
- if 30 >= dist then else return end
- data.Value = true;
- end);
- end;
- end);
Add Comment
Please, Sign In to add comment