Advertisement
KrYn0MoRe

minecraft smite command

Jan 28th, 2023 (edited)
1,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.93 KB | None | 0 0
  1. local Base = Instance.new("Part")
  2. Base.Color = Color3.new(1,1,1)
  3. Base.Anchored = true
  4. Base.Transparency = 1
  5.  
  6. function dot(c1,c2)
  7.     local m = CFrame.Angles(math.pi/2,0,0)
  8.     return (c1*m).lookVector:Dot((c2*m).lookVector)
  9. end
  10.  
  11. function Branch(base,c,par,mode)
  12.     if c <= 0 then
  13.  
  14.         local vol = base.Size.x+base.Size.y+base.Size.z
  15.     else
  16.  
  17.         local pos = base.CFrame*CFrame.new(0,base.Size/2,0)
  18.         local height = base.Size.y
  19.         local width = base.Size.x
  20.         local nb = 1
  21.         local r = math.random(3,25)
  22.  
  23.         local da = math.random(20+55/c,40+40/c)
  24.  
  25.  
  26.         local ba = math.random(-da/3,da/3)
  27.  
  28.         for i=0,nb-1 do
  29.             local branch = base:Clone()
  30.             branch.Name = "Branch"
  31.             branch.Parent = par
  32.             branch.CanCollide = false
  33.             local size = 0
  34.             if mode == 1 then
  35.                 size = 1
  36.             else
  37.                 size = 2
  38.             end
  39.             local trans = .2
  40.             for i = 0,3,1 do
  41.                 local semi_bolt = branch:Clone()
  42.                 semi_bolt.Parent = par
  43.                 semi_bolt.Size = Vector3.new(size,height,size)
  44.                 semi_bolt.Transparency = trans
  45.                 semi_bolt.CanCollide = false
  46.                 if mode == 1 then
  47.                     size =  size + 1
  48.                 else
  49.                     size = size + 2
  50.                 end
  51.                 trans = trans + .2
  52.                 game:GetService("Debris"):AddItem(semi_bolt,1.3)
  53.             end
  54.             branch.Size = Vector3.new(width,height,width)
  55.             branch.Transparency = .8
  56.             game:GetService("Debris"):AddItem(branch,1.3)
  57.             local h = height*math.random(95,115)/100
  58.  
  59.             local new = branch.CFrame * CFrame.new(0,height/2,0) * CFrame.Angles(0,0,math.rad(ba))
  60.             new = new * CFrame.Angles(0,i*(math.pi*2/nb)+r,math.rad(da/2)) * CFrame.new(0,h/2,0)
  61.  
  62.             local w = dot(new,branch.CFrame)*width*0.9
  63.  
  64.             branch.Size = Vector3.new(width,h,width)
  65.             branch.CFrame = new
  66.             branch.Parent = base.Parent
  67.  
  68.             Branch(branch,c-1,par,mode)
  69.         end
  70.     end
  71. end
  72.  
  73. local rain_s = Instance.new("Sound")
  74.  
  75. function rain(amount)
  76.     local Part0 = Instance.new("Part")
  77.     local ParticleEmitter1 = Instance.new("ParticleEmitter")
  78.     local Part3 = Instance.new("Part")
  79.     local ParticleEmitter4 = Instance.new("ParticleEmitter")
  80.     Part0.Name = "Rain_Fall"
  81.     Part0.Parent = script
  82.     Part0.CFrame = CFrame.new(0, 45.5, 0, 1, 4.99569069e-07, 7.38666245e-07, 4.99569012e-07, -0.999999702, -5.96046448e-08, 7.38666131e-07, 5.96046448e-08, -0.999999702)
  83.     Part0.Orientation = Vector3.new(0, 180, 180)
  84.     Part0.Position = Vector3.new(0, 45.5, 0)
  85.     Part0.Rotation = Vector3.new(180, 0, 0)
  86.     Part0.Transparency = 123123120
  87.     Part0.Size = Vector3.new(512, 1, 512)
  88.     Part0.Anchored = true
  89.     Part0.CanCollide = false
  90.     Part0.FormFactor = Enum.FormFactor.Symmetric
  91.     Part0.formFactor = Enum.FormFactor.Symmetric
  92.     ParticleEmitter1.Parent = Part0
  93.     ParticleEmitter1.Speed = NumberRange.new(100, 100)
  94.     ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.356863, 0.407843, 0.486275),Color3.new(0.47451, 0.552941, 0.694118))
  95.     ParticleEmitter1.LightEmission = 0.80000001192093
  96.     ParticleEmitter1.LightInfluence = 0.85000002384186
  97.     ParticleEmitter1.Texture = "rbxassetid://1890057258"
  98.     ParticleEmitter1.Transparency = NumberSequence.new(0,0.27607363462448,0)
  99.     ParticleEmitter1.Size = NumberSequence.new(2,2)
  100.     ParticleEmitter1.Lifetime = NumberRange.new(0.40000000596046, 0.40000000596046)
  101.     ParticleEmitter1.Rate = 2000
  102.     if not rain_s then
  103.         rain_s = Instance.new("Sound")
  104.     end
  105.     rain_s.Parent = script
  106.     rain_s.Looped = true
  107.     rain_s.SoundId = "rbxassetid://111816866"
  108.     rain_s.Volume = 5
  109.     rain_s:Play()
  110.     Part3.Name = "Rain_Splash"
  111.     Part3.Parent = script
  112.     Part3.CFrame = CFrame.new(0, 0.0500000007, 0, -0.999999702, -3.72529001e-07, 5.5381912e-07, -3.57627869e-07, 0.999999404, -5.79595905e-07, -5.53818722e-07, -5.79595905e-07, -0.999999702)
  113.     Part3.Orientation = Vector3.new(0, 180, 0)
  114.     Part3.Position = Vector3.new(0, 0.0500000007, 0)
  115.     Part3.Rotation = Vector3.new(180, 0, 180)
  116.     Part3.Transparency = 123123120
  117.     Part3.Size = Vector3.new(512, 0.100000001, 512)
  118.     Part3.Anchored = true
  119.     Part3.CanCollide = false
  120.     Part3.FormFactor = Enum.FormFactor.Symmetric
  121.     Part3.formFactor = Enum.FormFactor.Symmetric
  122.     ParticleEmitter4.Parent = Part3
  123.     ParticleEmitter4.Speed = NumberRange.new(1, 1)
  124.     ParticleEmitter4.Rotation = NumberRange.new(-360, -360)
  125.     ParticleEmitter4.Color = ColorSequence.new(Color3.new(0.803922, 0.909804, 1),Color3.new(0.486275, 0.545098, 0.615686))
  126.     ParticleEmitter4.LightEmission = 1
  127.     ParticleEmitter4.LightInfluence = 1
  128.     ParticleEmitter4.Texture = "rbxassetid://1890069725"
  129.     ParticleEmitter4.Transparency = NumberSequence.new(0,0.44171780347824,0.32515341043472,0.35582822561264,0.33742332458496,0.41104292869568,0.4355828166008,0.86503064632416,0.74846625328064,1)
  130.     ParticleEmitter4.Size = NumberSequence.new(0,1.4210522174835,0)
  131.     ParticleEmitter4.Lifetime = NumberRange.new(0.20000000298023, 0.20000000298023)
  132.     ParticleEmitter4.Rate = 2000
  133.     ParticleEmitter4.RotSpeed = NumberRange.new(-170, -170)
  134.     task.wait(amount)
  135.     Part3:Destroy()
  136.     Part0:Destroy()
  137.     coroutine.wrap(function()
  138.         for i = 0,5,0.1 do
  139.             task.wait()
  140.             rain_s.Volume = rain_s.Volume - .1
  141.         end
  142.     end)()
  143. end
  144.  
  145. local lightning = Instance.new("Sound")
  146. lightning.Parent = script
  147.  
  148. function hurt(mode,obj)
  149.     if obj and obj.Parent then else return end
  150.     for _,v in pairs(obj.Parent:GetDescendants()) do
  151.         local hum
  152.         if v:IsA("Humanoid") then
  153.             hum = v
  154.         end
  155.         if hum then
  156.             if mode == 1 then
  157.                 coroutine.wrap(function()
  158.                     local fire = Instance.new("Fire")
  159.                     fire.Parent = obj
  160.                     local fire_s = obj:FindFirstChild("fire_s_hurt") or Instance.new("Sound")
  161.                     fire_s.Name = 'fire_s_hurt'
  162.                     fire_s.SoundId = 'rbxassetid://8766809464'
  163.                     fire_s.Volume = 0.5
  164.                     fire_s.Parent = obj
  165.                     game:GetService("Debris"):AddItem(fire,15)
  166.                     local t = 0
  167.                     while fire and fire.Parent do
  168.                         t += 1
  169.                         if t > 3 then
  170.                             if math.random(1,4) == 1 then
  171.                                 fire:Destroy()
  172.                                 break
  173.                             end
  174.                         end
  175.                         if fire_s then
  176.                             fire_s:Play()
  177.                         end
  178.                         hum:TakeDamage(5)
  179.                         task.wait(1)
  180.                     end
  181.                 end)()
  182.                 hum:TakeDamage(hum.MaxHealth / 4)
  183.             else
  184.                 hum.Health = 0
  185.                 --hum.Parent:BreakJoints()
  186.             end
  187.         end
  188.     end
  189. end
  190.  
  191. function CreateSmite(tchar,location,complexity,width,height,mode)
  192.     local troot = tchar:FindFirstChild("HumanoidRootPart") or tchar:FindFirstChild("Torso")
  193.    
  194.     local old_br = game:GetService("Lighting").Brightness
  195.     local old_am = game:GetService("Lighting").OutdoorAmbient
  196.     local old_time = game:GetService("Lighting").ClockTime
  197.     old_time = (old_time-old_time % 0.1)
  198.  
  199.     coroutine.wrap(function()
  200.         rain(2)
  201.     end)()
  202.     local chosen_ct = 0.1
  203.     game:GetService("Lighting").ClockTime = chosen_ct
  204.    
  205.     if not lightning then
  206.         lightning = Instance.new("Sound")
  207.         lightning.Parent = script
  208.     end
  209.     if math.random(1,2) == 1 then
  210.         lightning.SoundId = "rbxassetid://178090362"
  211.     else
  212.         lightning.SoundId = "rbxassetid://446876721"
  213.     end
  214.     lightning.Volume = 5
  215.     lightning:Play()
  216.    
  217.     local size = 1
  218.     local trans = .2
  219.     local tree = Instance.new("Model")
  220.     tree.Parent = script
  221.     local bolt = Base:Clone()
  222.     bolt.Parent = tree
  223.     bolt.Transparency = 1
  224.     bolt.Size = Vector3.new(width,1000,width)
  225.     bolt.Transparency = .8
  226.     bolt.CanCollide = false
  227.     bolt.CFrame = CFrame.new(location) * CFrame.new(0,4,0) * CFrame.Angles(math.rad(math.random(-20,20)),0,math.rad(math.random(-20,20)))
  228.     game:GetService("Debris"):AddItem(bolt,1.3)
  229.    
  230.     local size = 0
  231.     if mode == 1 then
  232.         size = 1
  233.     else
  234.         size = 2
  235.     end
  236.     local trans = .2
  237.     for i = 0,3,1 do
  238.         local semi_bolt = bolt:Clone()
  239.         semi_bolt.Parent = tree
  240.         semi_bolt.Size = Vector3.new(size,1000,size)
  241.         semi_bolt.Transparency = trans
  242.         semi_bolt.CanCollide = false
  243.         game:GetService("Debris"):AddItem(semi_bolt,1.3)
  244.         if mode == 1 then
  245.             size =  size + 1
  246.         else
  247.             size = size + 2
  248.         end
  249.         trans = trans + .2
  250.     end
  251.    
  252.     --[[
  253.     coroutine.wrap(function()
  254.         Branch(bolt,complexity,tree,mode)
  255.     end)()
  256.     ]]
  257.    
  258.     coroutine.wrap(function()
  259.         hurt(mode,troot)
  260.     end)()
  261.    
  262.     local strike = Instance.new("Part")
  263.     local SpotLight1 = Instance.new("SpotLight")
  264.     strike.Name = "strike"
  265.     strike.Anchored = true
  266.     strike.CanCollide = false
  267.     strike.Parent = tree
  268.     strike.Position = location + Vector3.new(0,5,0)
  269.     strike.Transparency = 1
  270.     strike.Size = Vector3.new(10, 10, 10)
  271.     strike.BottomSurface = Enum.SurfaceType.Smooth
  272.     strike.TopSurface = Enum.SurfaceType.Smooth
  273.     SpotLight1.Parent = strike
  274.     SpotLight1.Face = Enum.NormalId.Top
  275.     SpotLight1.Range = 60
  276.     SpotLight1.Brightness = 10
  277.     SpotLight1.Shadows = true
  278.     game:GetService("Debris"):AddItem(strike,1)
  279.     local con
  280.     con = strike.Touched:Connect(function(obj)
  281.         --hurt(mode,obj)
  282.     end)
  283.     for i = 1,2 do
  284.         local nct = (game:GetService("Lighting").ClockTime-game:GetService("Lighting").ClockTime % 0.1)
  285.         if nct == chosen_ct and old_time ~= chosen_ct then else
  286.             return
  287.         end
  288.         game:GetService("Lighting").Brightness = 10
  289.         game:GetService("Lighting").OutdoorAmbient = Color3.new(1,1,1)
  290.         task.wait(0.1)
  291.         game:GetService("Lighting").Brightness = old_br
  292.         game:GetService("Lighting").OutdoorAmbient = old_am
  293.         task.wait(0.1)
  294.     end
  295.     task.wait(0.2)
  296.     local nct = (game:GetService("Lighting").ClockTime-game:GetService("Lighting").ClockTime % 0.1)
  297.     if nct == chosen_ct and old_time ~= chosen_ct then
  298.         game:GetService("Lighting").ClockTime = old_time
  299.     elseif old_time == chosen_ct then
  300.         game:GetService("Lighting").ClockTime = 14
  301.     end
  302.     task.wait(0.5)
  303.     game:GetService("Debris"):AddItem(tree,0.1)
  304. end
  305.  
  306. function GenerateBolt(...)
  307.     local t = {...}
  308.     coroutine.wrap(function()
  309.         CreateSmite(unpack(t))
  310.     end)()
  311. end
  312.  
  313. function GetPlr(plr, str)
  314.     local plrz = {} str = str:lower()
  315.     if str == "all" then plrz = game:GetService("Players"):children()
  316.     elseif str == "others" then for i, v in pairs(game:GetService("Players"):children()) do if v ~= plr then table.insert(plrz, v) end end
  317.     else
  318.         local sn = {1} local en = {}
  319.         for i = 1, #str do if str:sub(i,i) == "," then table.insert(sn, i+1) table.insert(en,i-1) end end
  320.         for x = 1, #sn do
  321.             if (sn[x] and en[x] and str:sub(sn[x],en[x]) == "me") or (sn[x] and str:sub(sn[x]) == "me") then table.insert(plrz, plr)
  322.                 if game:findFirstChild("Teams") then for a, v in pairs(game:GetService("Teams"):children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x],en[x]):sub(6)) == 1 then
  323.                             for q, p in pairs(game:GetService("Players"):children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
  324.                         end end end
  325.             elseif (sn[x] and str:sub(sn[x]):sub(1,4):lower() == "team") then
  326.                 if game:findFirstChild("Teams") then for a, v in pairs(game:GetService("Teams"):children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x]):sub(6)) == 1 then
  327.                             for q, p in pairs(game:GetService("Players"):children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
  328.                         end end end
  329.             else
  330.                 for a, plyr in pairs(game:GetService("Players"):children()) do
  331.                     if (sn[x] and en[x] and str:sub(sn[x],en[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x],en[x])) == 1) or (sn[x] and str:sub(sn[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x])) == 1) or (str ~= "" and plyr.Name:lower():find(str) == 1) then
  332.                         table.insert(plrz, plyr) break
  333.                     end
  334.                 end
  335.             end
  336.         end
  337.     end
  338.     return plrz
  339. end
  340.  
  341. local plr = owner
  342.  
  343. plr.Chatted:Connect(function(msg)
  344.     if msg:lower():sub(1,6) == 'smite/' then
  345.         local choice = GetPlr(plr, msg:lower():sub(7))
  346.         if choice ~= nil then
  347.             for i, v in pairs(choice) do
  348.                 if v then
  349.                     if v.Character:FindFirstChild("Torso") then
  350.                         GenerateBolt(v.Character,v.Character['Torso'].Position - Vector3.new(0,5,0), 20, 4, 50, 1)
  351.                     elseif v.Character:FindFirstChild("UpperTorso") then
  352.                         GenerateBolt(v.Character,v.Character['UpperTorso'].Position - Vector3.new(0,5,0), 20, 4, 50, 1)
  353.                     elseif v.Character:FindFirstChild("HumanoidRootPart") then
  354.                         GenerateBolt(v.Character,v.Character['HumanoidRootPart'].Position - Vector3.new(0,5,0), 20, 4, 50, 1)
  355.                     end
  356.                 end
  357.             end
  358.         end
  359.     end
  360.     if msg:lower():sub(1,9) == '/e smite/' then
  361.         local choice = GetPlr(plr, msg:lower():sub(10))
  362.         if choice ~= nil then
  363.             for i, v in pairs(choice) do
  364.                 if v then
  365.                     if v.Character:FindFirstChild("Torso") then
  366.                         GenerateBolt(v.Character,v.Character['Torso'].Position - Vector3.new(0,5,0), 20, 4, 50, 1)
  367.                     elseif v.Character:FindFirstChild("UpperTorso") then
  368.                         GenerateBolt(v.Character,v.Character['UpperTorso'].Position - Vector3.new(0,5,0), 20, 4, 50, 1)
  369.                     elseif v.Character:FindFirstChild("HumanoidRootPart") then
  370.                         GenerateBolt(v.Character,v.Character['HumanoidRootPart'].Position - Vector3.new(0,5,0), 20, 4, 50, 1)
  371.                     end
  372.                 end
  373.             end
  374.         end
  375.     end
  376.     if msg:lower():sub(1,7) == 'lsmite/' then
  377.         local choice = GetPlr(plr, msg:lower():sub(8))
  378.         if choice ~= nil then
  379.             for i, v in pairs(choice) do
  380.                 if v then
  381.                     if v.Character:FindFirstChild("Torso") then
  382.                         GenerateBolt(v.Character,v.Character['Torso'].Position - Vector3.new(0,6,0), 20, 8, 50, 2)
  383.                     elseif v.Character:FindFirstChild("UpperTorso") then
  384.                         GenerateBolt(v.Character,v.Character['UpperTorso'].Position - Vector3.new(0,6,0), 20, 8, 50, 2)
  385.                     elseif v.Character:FindFirstChild("HumanoidRootPart") then
  386.                         GenerateBolt(v.Character,v.Character['HumanoidRootPart'].Position - Vector3.new(0,6,0), 20, 8, 50, 2)
  387.                     end
  388.                 end
  389.             end
  390.         end
  391.     end
  392.     if msg:lower():sub(1,10) == '/e lsmite/' then
  393.         local choice = GetPlr(plr, msg:lower():sub(11))
  394.         if choice ~= nil then
  395.             for i, v in pairs(choice) do
  396.                 if v then
  397.                     if v.Character:FindFirstChild("Torso") then
  398.                         GenerateBolt(v.Character,v.Character['Torso'].Position - Vector3.new(0,6,0), 20, 8, 50, 2)
  399.                     elseif v.Character:FindFirstChild("UpperTorso") then
  400.                         GenerateBolt(v.Character,v.Character['UpperTorso'].Position - Vector3.new(0,6,0), 20, 8, 50, 2)
  401.                     elseif v.Character:FindFirstChild("HumanoidRootPart") then
  402.                         GenerateBolt(v.Character,v.Character['HumanoidRootPart'].Position - Vector3.new(0,6,0), 20, 8, 50, 2)
  403.                     end
  404.                 end
  405.             end
  406.         end
  407.     end
  408. end)
  409.  
  410. warn([[
  411.  
  412. smite/plr
  413. /e smite/plr
  414. lsmite/plr
  415. /e lsmite/plr
  416. ]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement