Advertisement
TheUnknownDiscord

somethingwicked

Nov 19th, 2022 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.78 KB | None | 0 0
  1. game:GetService("Players").PlayerAdded:Connect(function(v)
  2. v.Chatted:Connect(function(wha)
  3. pcall(function()
  4. if wha == "-flashlight" and not (v.Backpack:FindFirstChild("flashlight") or v.Character:FindFirstChild("flashlight")) then
  5. local t = Instance.new("Tool",v.Backpack)
  6. t.Name = "flashlight"
  7. local p = Instance.new("Part",t)
  8. p.Name = "Handle"
  9. p.Size = Vector3.new(0.587, 0.587, 3.124)
  10. local m = Instance.new("SpecialMesh",p)
  11. m.MeshId = "rbxassetid://186494905"
  12. m.TextureId = "rbxassetid://186494927"
  13. local flash = Instance.new("SpotLight", p)
  14. flash.Brightness = 5
  15. flash.Range = 50
  16. flash.Shadows = true
  17. flash.Face = "Front"
  18. flash.Angle = 55
  19. flash.Enabled = false
  20. local ll = Instance.new("Sound",p)
  21. ll.SoundId = "rbxassetid://577891804"
  22. ll.Volume = 1
  23. t.Activated:Connect(function()
  24. flash.Enabled = not flash.Enabled
  25. ll:Play()
  26. end)
  27. end
  28. end)
  29. end)
  30. v.CharacterAdded:Connect(function(char)
  31. if char.Head then
  32. local l = Instance.new("PointLight",char.Head)
  33. l.Shadows = true
  34. l.Brightness = 10
  35. l.Color = Color3.fromRGB(50, 50, 50)
  36. l.Range = 10
  37. end
  38. end)
  39. end)
  40. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  41. pcall(function()
  42. v.Chatted:Connect(function(wha)
  43. pcall(function()
  44. if wha == "-flashlight" and not (v.Backpack:FindFirstChild("flashlight") or v.Character:FindFirstChild("flashlight")) then
  45. local t = Instance.new("Tool",v.Backpack)
  46. t.Name = "flashlight"
  47. local p = Instance.new("Part",t)
  48. p.Name = "Handle"
  49. p.Size = Vector3.new(0.587, 0.587, 3.124)
  50. local m = Instance.new("SpecialMesh",p)
  51. m.MeshId = "rbxassetid://186494905"
  52. m.TextureId = "rbxassetid://186494927"
  53. local flash = Instance.new("SpotLight", p)
  54. flash.Brightness = 5
  55. flash.Range = 50
  56. flash.Shadows = true
  57. flash.Face = "Front"
  58. flash.Angle = 55
  59. flash.Enabled = false
  60. local ll = Instance.new("Sound",p)
  61. ll.SoundId = "rbxassetid://577891804"
  62. ll.Volume = 1
  63. t.Activated:Connect(function()
  64. flash.Enabled = not flash.Enabled
  65. ll:Play()
  66. end)
  67. end
  68. end)
  69. end)
  70. v.CharacterAdded:Connect(function(char)
  71. if char.Head then
  72. local l = Instance.new("PointLight",char.Head)
  73. l.Shadows = true
  74. l.Brightness = 10
  75. l.Color = Color3.fromRGB(50, 50, 50)
  76. l.Range = 10
  77. end
  78. end)
  79. if v.Character and v.Character.Head then
  80. local l = Instance.new("PointLight",v.Character.Head)
  81. l.Shadows = true
  82. l.Brightness = 10
  83. l.Color = Color3.fromRGB(50, 50, 50)
  84. l.Range = 10
  85. end
  86. end)
  87. end
  88. local Lighting = game:GetService("Lighting")
  89. local tweenService = game:GetService("TweenService")
  90. local tweenInfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
  91. local goal = {}
  92. goal.ClockTime = 0
  93. goal.Brightness = 0.4
  94. goal.OutdoorAmbient = Color3.fromRGB(0,0,0)
  95. goal.FogColor = Color3.fromRGB(0,0,0)
  96. goal.Ambient = Color3.fromRGB(0,0,0)
  97. goal.EnvironmentDiffuseScale = -2
  98. goal.FogEnd = 500
  99. goal.FogStart = 600
  100. goal.ColorShift_Bottom = Color3.fromRGB(0,0,0)
  101. goal.ColorShift_Top = Color3.fromRGB(0,0,0)
  102. local hint = Instance.new("Hint",workspace)
  103. hint.Text = "something wicked this way comes..."
  104. coroutine.wrap(function()
  105. wait(1.5)
  106. hint.Text = "-flashlight for flashlight"
  107. end)()
  108. local tween = tweenService:Create(Lighting, tweenInfo, goal)
  109. tween:Play()
  110. local s = Instance.new("Sound",workspace)
  111. s.SoundId = "rbxassetid://7043921697"
  112. s.PlayOnRemove = true
  113. s:Destroy()
  114. for i = 1,1 do
  115. wait(0.1)
  116. coroutine.wrap(function()
  117. local part = Instance.new("Part",script)
  118. part.Anchored = true
  119. part.CFrame = owner.Character.Head.CFrame * CFrame.Angles(math.rad(90),0,0)
  120. part.Position = owner.Character.Head.Position - Vector3.new(0,1,0)
  121. part.Size = Vector3.new(2,4,6)
  122. part.Color = Color3.fromRGB(17,17,17)
  123. part.CanCollide = false
  124. local light = Instance.new("PointLight",part)
  125. light.Shadows = true
  126. light.Brightness = 0.2
  127. light.Color = Color3.fromRGB(100, 50, 50)
  128. light.Range = 13
  129. part.Name = "something wicked this way comes..."
  130. local m = Instance.new("SpecialMesh",part)
  131. m.MeshId = "rbxassetid://9905413775"
  132. m.Scale = Vector3.new(0.5,0.5,0.5)
  133. local s = Instance.new("Sound",part)
  134. s.SoundId = "rbxassetid://7043921697"
  135. part.Transparency = 0.88
  136. local function findNearestTorso(pos)
  137. local list = game.Workspace:GetChildren()
  138. local torso = nil
  139. local dist = 70
  140. local temp = nil
  141. local human = nil
  142. local temp2 = nil
  143. for x = 1, #list do
  144. temp2 = list[x]
  145. if (temp2.className == "Model") and (temp2 ~= model) then
  146. temp = temp2:findFirstChild("Head")
  147. human = temp2:findFirstChild("Humanoid")
  148. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) and (temp2 ~= part:FindFirstAncestorWhichIsA("Model")) then
  149. if (temp.Position - pos).magnitude < dist then
  150. local raycastParams = RaycastParams.new()
  151. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  152. raycastParams.FilterDescendantsInstances = {temp2,part}
  153. raycastParams.IgnoreWater = true
  154. local result = workspace:Raycast(part.Position, CFrame.new(part.Position,temp.Position).lookVector * (part.Position - temp.Position).Magnitude, raycastParams)
  155. if not result then
  156. torso = temp
  157. mod = temp2
  158. dist = (temp.Position - pos).magnitude
  159. end
  160. end
  161. end
  162. end
  163. end
  164. return torso
  165. end
  166. local attack = false
  167. part.Touched:Connect(function(wha)
  168. if attack then
  169. if wha:FindFirstAncestorWhichIsA("Model") and wha:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid") then
  170. wha:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid").Health -= 10
  171. wha:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid").Sit = true
  172. pcall(function()
  173. coroutine.wrap(function()
  174. local rnd = Random.new()
  175. local bv = Instance.new("BodyVelocity", wha:FindFirstAncestorWhichIsA("Model").Head)
  176. bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  177. bv.Velocity = (part.CFrame.upVector * -30) + Vector3.new(0, 30, 0)
  178. task.wait(.05)
  179. bv.MaxForce = Vector3.new()
  180. bv.Velocity = Vector3.new()
  181. wha:FindFirstAncestorWhichIsA("Model").Head.RotVelocity = Vector3.new(rnd:NextNumber(-5, 5), rnd:NextNumber(-5, 5), rnd:NextNumber(-5, 5))
  182. bv:Destroy()
  183. end)()
  184. end)
  185. attack = false
  186. end
  187. end
  188. end)
  189. -- 7, 12
  190. while wait(math.random(5,9)) do
  191. local torso = findNearestTorso(part.Position)
  192. if torso ~= nil then
  193. s.Pitch = 1 + (math.random(-5,5)/25)
  194. s:Play()
  195. part.CFrame = CFrame.new(part.Position) * CFrame.Angles(CFrame.new(part.Position, torso.Position):ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(90),0,0) * CFrame.new(0,15,0)
  196. -- 3,4
  197. wait(math.random(3,4))
  198. attack = true
  199. part.Transparency = 0
  200. light.Brightness = 20
  201. part.CFrame = CFrame.new(part.Position) * CFrame.Angles(CFrame.new(part.Position, torso.Position):ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(90),0,0) * CFrame.new(0,15,0)
  202. part.Position = part.Position - Vector3.new(0,1,0)
  203. local tweenService = game:GetService("TweenService")
  204. local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
  205. local goal = {}
  206. goal.CFrame = CFrame.new(part.Position) * CFrame.Angles(CFrame.new(part.Position, torso.Position + torso.Velocity):ToEulerAnglesXYZ()) * CFrame.new(0,0,-((part.Position - torso.Position).Magnitude + 30)) * CFrame.Angles(math.rad(90),0,0)
  207. local tween = tweenService:Create(part, tweenInfo, goal)
  208. tween:Play()
  209. tween.Completed:Wait()
  210. attack = false
  211. s.Pitch = 3 + (math.random(-5,5)/25)
  212. s:Play()
  213. coroutine.wrap(function()
  214. for i = 1,20 do
  215. part.Transparency = 0.88 * (0.05 * i)
  216. light.Brightness = i
  217. wait()
  218. end
  219. end)()
  220. coroutine.wrap(function()
  221. for i = 10,0.2,-0.1 do
  222. light.Brightness = i
  223. task.wait()
  224. end
  225. end)()
  226. local tweenService = game:GetService("TweenService")
  227. local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
  228. local goal = {}
  229. local x,y,z = CFrame.new(torso.Position,(torso.CFrame * CFrame.new(math.random(-50,50),0,math.random(-50,50))).Position):ToEulerAnglesXYZ()
  230. goal.CFrame = CFrame.new((torso.CFrame * CFrame.new(math.random(-50,50),0,math.random(-50,50))).Position) * CFrame.Angles(x,y,z) * CFrame.Angles(math.rad(90),0,0)
  231. local tween = tweenService:Create(part, tweenInfo, goal)
  232. tween:Play()
  233. else
  234. part.Transparency = 0
  235. light.Brightness = 10
  236. coroutine.wrap(function()
  237. for i = 1,20 do
  238. part.Transparency = 0.88 * (0.05 * i)
  239. light.Brightness = i
  240. wait()
  241. end
  242. end)()
  243. coroutine.wrap(function()
  244. for i = 10,0.2,-0.1 do
  245. light.Brightness = i
  246. task.wait()
  247. end
  248. end)()
  249. local tweenService = game:GetService("TweenService")
  250. local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
  251. local goal = {}
  252. local x,y,z = CFrame.new(part.Position,(part.CFrame * CFrame.new(math.random(-50,50),math.random(-50,50),0)).Position):ToEulerAnglesXYZ()
  253. goal.CFrame = CFrame.new((part.CFrame * CFrame.new(math.random(-50,50),math.random(-50,50),0)).Position) * CFrame.Angles(x,y,z) * CFrame.Angles(math.rad(90),0,0)
  254. local tween = tweenService:Create(part, tweenInfo, goal)
  255. tween:Play()
  256. s.Pitch = 3 + (math.random(-5,5)/25)
  257. s:Play()
  258. end
  259. end
  260. end)()
  261. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement