Advertisement
KrYn0MoRe

starlight

Dec 22nd, 2019
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.05 KB | None | 0 0
  1. --By Rufus14
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4.     local env = getfenv(func)
  5.     local newenv = setmetatable({},{
  6.         __index = function(self,k)
  7.             if k=="script" then
  8.                 return var
  9.             else
  10.                 return env[k]
  11.             end
  12.         end,
  13.     })
  14.     setfenv(func,newenv)
  15.     return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Part3 = Instance.new("Part")
  23. SpecialMesh4 = Instance.new("SpecialMesh")
  24. Part5 = Instance.new("Part")
  25. SpecialMesh6 = Instance.new("SpecialMesh")
  26. Weld7 = Instance.new("Weld")
  27. Weld8 = Instance.new("Weld")
  28. Sound9 = Instance.new("Sound")
  29. Sound10 = Instance.new("Sound")
  30. PointLight11 = Instance.new("PointLight")
  31. Script12 = Instance.new("Script")
  32. Tool0.Name = "Phial of Galadriel"
  33. Tool0.Parent = mas
  34. Part1.Name = "b"
  35. Part1.Parent = Tool0
  36. Part1.CFrame = CFrame.new(14.9249907, 0.900027037, 21.7563553, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  37. Part1.Orientation = Vector3.new(0, 90, 0)
  38. Part1.Position = Vector3.new(14.9249907, 0.900027037, 21.7563553)
  39. Part1.Rotation = Vector3.new(0, 90, 0)
  40. Part1.Color = Color3.new(0.972549, 0.972549, 0.972549)
  41. Part1.Size = Vector3.new(1.64770472, 0.250737697, 0.250737697)
  42. Part1.BottomSurface = Enum.SurfaceType.Smooth
  43. Part1.BrickColor = BrickColor.new("Institutional white")
  44. Part1.Material = Enum.Material.Neon
  45. Part1.TopSurface = Enum.SurfaceType.Smooth
  46. Part1.brickColor = BrickColor.new("Institutional white")
  47. SpecialMesh2.Parent = Part1
  48. SpecialMesh2.MeshType = Enum.MeshType.Cylinder
  49. Part3.Name = "a"
  50. Part3.Parent = Tool0
  51. Part3.CFrame = CFrame.new(14.9249907, 0.900026977, 21.1116028, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  52. Part3.Orientation = Vector3.new(0, 90, 0)
  53. Part3.Position = Vector3.new(14.9249907, 0.900026977, 21.1116028)
  54. Part3.Rotation = Vector3.new(0, 90, 0)
  55. Part3.Color = Color3.new(0.972549, 0.972549, 0.972549)
  56. Part3.Size = Vector3.new(0.21491766, 0.322377056, 0.322377056)
  57. Part3.BottomSurface = Enum.SurfaceType.Smooth
  58. Part3.BrickColor = BrickColor.new("Institutional white")
  59. Part3.Material = Enum.Material.Neon
  60. Part3.TopSurface = Enum.SurfaceType.Smooth
  61. Part3.brickColor = BrickColor.new("Institutional white")
  62. SpecialMesh4.Parent = Part3
  63. SpecialMesh4.MeshType = Enum.MeshType.Cylinder
  64. Part5.Name = "Handle"
  65. Part5.Parent = Tool0
  66. Part5.CFrame = CFrame.new(14.9249945, 0.875027001, 22.4011116, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  67. Part5.Orientation = Vector3.new(0, 90, 0)
  68. Part5.Position = Vector3.new(14.9249945, 0.875027001, 22.4011116)
  69. Part5.Rotation = Vector3.new(0, 90, 0)
  70. Part5.Color = Color3.new(0.972549, 0.972549, 0.972549)
  71. Part5.Size = Vector3.new(1.43278694, 0.866393507, 0.816393495)
  72. Part5.BottomSurface = Enum.SurfaceType.Smooth
  73. Part5.BrickColor = BrickColor.new("Institutional white")
  74. Part5.Material = Enum.Material.Neon
  75. Part5.TopSurface = Enum.SurfaceType.Smooth
  76. Part5.brickColor = BrickColor.new("Institutional white")
  77. SpecialMesh6.Parent = Part5
  78. SpecialMesh6.MeshType = Enum.MeshType.Sphere
  79. Weld7.Parent = Part5
  80. Weld7.C0 = CFrame.new(1.28950882, 0.0249999762, -3.81469727e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  81. Weld7.Part0 = Part5
  82. Weld7.Part1 = Part3
  83. Weld7.part1 = Part3
  84. Weld8.Parent = Part5
  85. Weld8.C0 = CFrame.new(0.644756317, 0.025000006, -3.81469727e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  86. Weld8.Part0 = Part5
  87. Weld8.Part1 = Part1
  88. Weld8.part1 = Part1
  89. Sound9.Name = "Use"
  90. Sound9.Parent = Part5
  91. Sound9.Looped = true
  92. Sound9.EmitterSize = 50
  93. Sound9.MinDistance = 50
  94. Sound9.SoundId = "rbxassetid://596782957"
  95. Sound9.Volume = 1
  96. Sound10.Name = "Breaksound"
  97. Sound10.Parent = Part5
  98. Sound10.Pitch = 0.80000001192093
  99. Sound10.PlayOnRemove = true
  100. Sound10.PlaybackSpeed = 0.80000001192093
  101. Sound10.SoundId = "rbxassetid://156444949"
  102. Sound10.Volume = 1
  103. PointLight11.Parent = Part5
  104. PointLight11.Range = 15
  105. PointLight11.Brightness = 1.5
  106. Script12.Name = "Starlight"
  107. Script12.Parent = Tool0
  108. table.insert(cors,sandbox(Script12,function()
  109. --By Rufus14
  110. --[[
  111.     What it does:
  112.     -It repels npc's with "Zombie" in their name
  113.     -characters have to be in workspace to make repel function work
  114. ]]--
  115. local bad = {"dummy","ghost","zombie","brute","demon","satan","evil","creature","dragon"}
  116. tool = script.Parent
  117. owner = nil
  118. handle = tool.Handle
  119. usesound = handle.Use
  120. breaksound = handle.Breaksound
  121. step = game:GetService("RunService").Stepped
  122. tookon = false
  123. sine = 0
  124. usemeter = 1300
  125. function equipped()
  126.     tookon = true
  127.     if usemeter ~= 0 then
  128.         usesound:Play()
  129.     end
  130.     owner = tool.Parent
  131.     if owner:findFirstChild("Torso") then
  132.         local toolweld = owner["Right Arm"]:WaitForChild("RightGrip")
  133.         toolweld.C0 = toolweld.C0 * CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.6,0,0)
  134.         if owner:findFirstChild("Left Arm") then
  135.             local leftarm = Instance.new("Weld", owner.Torso)
  136.             leftarm.Part0 = owner.Torso
  137.             leftarm.Part1 = owner["Left Arm"]
  138.             leftarm.C0 = CFrame.new(-1.5,0.5,0)
  139.             leftarm.C1 = CFrame.new(0,0.5,0)
  140.             leftarm.Name = "LeftArmWeldd"
  141.         end
  142.         if owner:findFirstChild("Right Arm") then
  143.             local rightarm = Instance.new("Weld", owner.Torso)
  144.             rightarm.Part0 = owner.Torso
  145.             rightarm.Part1 = owner["Right Arm"]
  146.             rightarm.C0 = CFrame.new(1.5,0.5,0)
  147.             rightarm.C1 = CFrame.new(0,0.5,0)
  148.             rightarm.Name = "RightArmWeldd"
  149.         end
  150.         local head = Instance.new("Weld", owner.Torso)
  151.         head.Part0 = owner.Torso
  152.         head.Part1 = owner.Head
  153.         head.C0 = CFrame.new(0,1,0)
  154.         head.C1 = CFrame.new(0,-0.5,0)
  155.         head.Name = "HeadWeldd"
  156.         local function animate()
  157.             while tookon and step:wait() do
  158.                 sine = sine - 1
  159.                 head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(5)+math.rad(2*math.sin(sine/50)),-math.rad(10)+math.rad(3*math.cos(sine/50)),0),0.15)
  160.                 if owner.Torso:findFirstChild("LeftArmWeldd") then
  161.                     owner.Torso:findFirstChild("LeftArmWeldd").C0 = owner.Torso:findFirstChild("LeftArmWeldd").C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,math.rad(-10)+math.rad(3*math.cos(sine/50))),0.15)
  162.                 end
  163.                 if owner.Torso:findFirstChild("RightArmWeldd") then
  164.                     owner.Torso:findFirstChild("RightArmWeldd").C0 = owner.Torso:findFirstChild("RightArmWeldd").C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles((math.pi)-math.rad(15)+math.rad(3*math.sin(sine/50)),0,0),0.15)
  165.                 end
  166.             end
  167.         end
  168.         spawn(animate)
  169.         while tookon and usemeter ~= 0 do
  170.             usemeter = usemeter - 1
  171.             if usemeter == 0 then
  172.                 tool.Parent = workspace
  173.                 if handle:findFirstChildOfClass("PointLight") then
  174.                     breaksound:Play()
  175.                     handle.Transparency = 0.6
  176.                     if tool:findFirstChild("a") then
  177.                         tool.a.Transparency = 0.6
  178.                     end
  179.                     if tool:findFirstChild("b") then
  180.                         tool.b.Transparency = 0.6
  181.                     end
  182.                     handle:findFirstChildOfClass("PointLight"):destroy()
  183.                 end
  184.             end
  185.             for i,v in pairs(workspace:GetChildren()) do
  186.                 if v.ClassName == "Model" and v ~= owner and not game:GetService("Players"):GetPlayerFromCharacter(v) then
  187.                     local zombiehumanoid = v:findFirstChildOfClass("Humanoid")
  188.                     local zombiehead = v:findFirstChild("Head")
  189.                     if zombiehumanoid and zombiehead then
  190.                         if (zombiehead.Position - handle.Position).magnitude <= 30 then
  191.                            
  192.                             for _,evil in pairs(bad) do
  193.                                 if string.find(string.lower(v.Name),evil,1) then
  194.                                     walkaway(v, zombiehead, zombiehumanoid)
  195.                                 elseif zombiehumanoid.Name == string.find(string.lower(v.Name),evil,1) then --check if humanoid is named zombie
  196.                                     walkaway(v, zombiehead, zombiehumanoid)
  197.                                 end
  198.                             end
  199.                         elseif zombiehead:findFirstChild("c-cat_noises") then --anti grey cat script
  200.                             walkaway(v, zombiehead, zombiehumanoid)
  201.                         elseif v:findFirstChildOfClass("Sound") then
  202.                             if v:findFirstChildOfClass("Sound").SoundId == "rbxassetid://614032233" or v:findFirstChildOfClass("Sound").SoundId == "rbxassetid://415898123" or v:findFirstChildOfClass("Sound").Name == "wrecked" then
  203.                                 walkaway(v, zombiehead, zombiehumanoid)
  204.                             end
  205.                         elseif v:findFirstChild("_status") then
  206.                             if v["_status"]:findFirstChildOfClass("TextLabel") then
  207.                                 walkaway(v, zombiehead, zombiehumanoid)
  208.                             end
  209.                         end
  210.                     end
  211.                 end
  212.             end
  213.             step:wait()
  214.         end
  215.     end
  216. end
  217. function walkaway(zombie, hed, humanoidzombie)
  218.     if not zombie:findFirstChild("okbroimgoing") then
  219.         local okimgoing = Instance.new("BoolValue", zombie)
  220.         okimgoing.Name = "okbroimgoing"
  221.         local function makeapath()
  222.             local function pathspawn()
  223.                 local randompart = Instance.new("Part", workspace)
  224.                 randompart.CFrame = CFrame.new(hed.Position, handle.Position)
  225.                 randompart.Anchored = true
  226.                 randompart.CanCollide = false
  227.                 randompart.Transparency = 1
  228.                 randompart.CFrame = randompart.CFrame * CFrame.new(math.random(-30,30),math.random(-30,30),math.random(10,30))
  229.                 humanoidzombie.WalkToPoint = randompart.Position
  230.                 local path = game:GetService("PathfindingService"):FindPathAsync(hed.Position, randompart.Position)
  231.                 local points = path:GetWaypoints()
  232.                 randompart:destroy()
  233.                 local threshold = 0
  234.                 if path.Status == Enum.PathStatus.Success then
  235.                     local chance = 2
  236.                     humanoidzombie.WalkSpeed = 30
  237.                     local function run()
  238.                         wait(0.5)
  239.                         humanoidzombie.WalkSpeed = 16
  240.                     end
  241.                     spawn(run)
  242.                     for q,w in pairs(points) do
  243.                         threshold = 0
  244.                         while (hed.Position - w.Position).magnitude >= 5.5 and threshold <= 39 and chance ~= 0 do
  245.                             humanoidzombie.WalkToPoint = w.Position
  246.                             threshold = threshold + 1
  247.                             if threshold >= 40 then
  248.                                 chance = chance - 1
  249.                                 break
  250.                             end
  251.                             if w.Action == Enum.PathWaypointAction.Jump then
  252.                                 humanoidzombie.Jump = true
  253.                             end
  254.                             step:wait()
  255.                         end
  256.                     end
  257.                     okimgoing:destroy()
  258.                 else
  259.                     makeapath()
  260.                 end
  261.             end
  262.             spawn(pathspawn)
  263.         end
  264.         makeapath()
  265.     end
  266. end
  267. function unequipped()
  268.     tookon = false
  269.     usesound:Stop()
  270.     if owner:findFirstChild("Torso") then
  271.         for i = 0,1 , 0.04 do
  272.             if owner.Torso:findFirstChild("HeadWeldd") then
  273.                 owner.Torso:findFirstChild("HeadWeldd").C0 = owner.Torso:findFirstChild("HeadWeldd").C0:lerp(CFrame.new(0,1,0),0.15)
  274.             end
  275.             if owner.Torso:findFirstChild("LeftArmWeldd") then
  276.                 owner.Torso:findFirstChild("LeftArmWeldd").C0 = owner.Torso:findFirstChild("LeftArmWeldd").C0:lerp(CFrame.new(-1.5,0.5,0),0.15)
  277.             end
  278.             if owner.Torso:findFirstChild("RightArmWeldd") then
  279.                 owner.Torso:findFirstChild("RightArmWeldd").C0 = owner.Torso:findFirstChild("RightArmWeldd").C0:lerp(CFrame.new(1.5,0.5,0),0.15)
  280.             end
  281.             step:wait()
  282.         end
  283.         if owner.Torso:findFirstChild("RightArmWeldd") then
  284.             owner.Torso:findFirstChild("RightArmWeldd"):destroy()
  285.         end
  286.         if owner.Torso:findFirstChild("LeftArmWeldd") then
  287.             owner.Torso:findFirstChild("LeftArmWeldd"):destroy()
  288.         end
  289.         if owner.Torso:findFirstChild("HeadWeldd") then
  290.             owner.Torso:findFirstChild("HeadWeldd"):destroy()
  291.         end
  292.     end
  293. end
  294. tool.Equipped:connect(equipped)
  295. tool.Unequipped:connect(unequipped)
  296. end))
  297. for i,v in pairs(mas:GetChildren()) do
  298.     v.Parent = owner.Character
  299.     pcall(function() v:MakeJoints() end)
  300. end
  301. mas:Destroy()
  302. for i,v in pairs(cors) do
  303.     spawn(function()
  304.         pcall(v)
  305.     end)
  306. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement