Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game:GetService("Players").PlayerAdded:Connect(function(v)
- v.Chatted:Connect(function(wha)
- pcall(function()
- if wha == "-flashlight" and not (v.Backpack:FindFirstChild("flashlight") or v.Character:FindFirstChild("flashlight")) then
- local t = Instance.new("Tool",v.Backpack)
- t.Name = "flashlight"
- local p = Instance.new("Part",t)
- p.Name = "Handle"
- p.Size = Vector3.new(0.587, 0.587, 3.124)
- local m = Instance.new("SpecialMesh",p)
- m.MeshId = "rbxassetid://186494905"
- m.TextureId = "rbxassetid://186494927"
- local flash = Instance.new("SpotLight", p)
- flash.Brightness = 5
- flash.Range = 50
- flash.Shadows = true
- flash.Face = "Front"
- flash.Angle = 55
- flash.Enabled = false
- local ll = Instance.new("Sound",p)
- ll.SoundId = "rbxassetid://577891804"
- ll.Volume = 1
- t.Activated:Connect(function()
- flash.Enabled = not flash.Enabled
- ll:Play()
- end)
- end
- end)
- end)
- v.CharacterAdded:Connect(function(char)
- if char.Head then
- local l = Instance.new("PointLight",char.Head)
- l.Shadows = true
- l.Brightness = 10
- l.Color = Color3.fromRGB(50, 50, 50)
- l.Range = 10
- end
- end)
- end)
- for i,v in pairs(game:GetService("Players"):GetPlayers()) do
- pcall(function()
- v.Chatted:Connect(function(wha)
- pcall(function()
- if wha == "-flashlight" and not (v.Backpack:FindFirstChild("flashlight") or v.Character:FindFirstChild("flashlight")) then
- local t = Instance.new("Tool",v.Backpack)
- t.Name = "flashlight"
- local p = Instance.new("Part",t)
- p.Name = "Handle"
- p.Size = Vector3.new(0.587, 0.587, 3.124)
- local m = Instance.new("SpecialMesh",p)
- m.MeshId = "rbxassetid://186494905"
- m.TextureId = "rbxassetid://186494927"
- local flash = Instance.new("SpotLight", p)
- flash.Brightness = 5
- flash.Range = 50
- flash.Shadows = true
- flash.Face = "Front"
- flash.Angle = 55
- flash.Enabled = false
- local ll = Instance.new("Sound",p)
- ll.SoundId = "rbxassetid://577891804"
- ll.Volume = 1
- t.Activated:Connect(function()
- flash.Enabled = not flash.Enabled
- ll:Play()
- end)
- end
- end)
- end)
- v.CharacterAdded:Connect(function(char)
- if char.Head then
- local l = Instance.new("PointLight",char.Head)
- l.Shadows = true
- l.Brightness = 10
- l.Color = Color3.fromRGB(50, 50, 50)
- l.Range = 10
- end
- end)
- if v.Character and v.Character.Head then
- local l = Instance.new("PointLight",v.Character.Head)
- l.Shadows = true
- l.Brightness = 10
- l.Color = Color3.fromRGB(50, 50, 50)
- l.Range = 10
- end
- end)
- end
- local Lighting = game:GetService("Lighting")
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
- local goal = {}
- goal.ClockTime = 0
- goal.Brightness = 0.4
- goal.OutdoorAmbient = Color3.fromRGB(0,0,0)
- goal.FogColor = Color3.fromRGB(0,0,0)
- goal.Ambient = Color3.fromRGB(0,0,0)
- goal.EnvironmentDiffuseScale = -2
- goal.FogEnd = 500
- goal.FogStart = 600
- goal.ColorShift_Bottom = Color3.fromRGB(0,0,0)
- goal.ColorShift_Top = Color3.fromRGB(0,0,0)
- local hint = Instance.new("Hint",workspace)
- hint.Text = "something wicked this way comes..."
- coroutine.wrap(function()
- wait(1.5)
- hint.Text = "-flashlight for flashlight"
- end)()
- local tween = tweenService:Create(Lighting, tweenInfo, goal)
- tween:Play()
- local s = Instance.new("Sound",workspace)
- s.SoundId = "rbxassetid://7043921697"
- s.PlayOnRemove = true
- s:Destroy()
- for i = 1,1 do
- wait(0.1)
- coroutine.wrap(function()
- local part = Instance.new("Part",script)
- part.Anchored = true
- part.CFrame = owner.Character.Head.CFrame * CFrame.Angles(math.rad(90),0,0)
- part.Position = owner.Character.Head.Position - Vector3.new(0,1,0)
- part.Size = Vector3.new(2,4,6)
- part.Color = Color3.fromRGB(17,17,17)
- part.CanCollide = false
- local light = Instance.new("PointLight",part)
- light.Shadows = true
- light.Brightness = 0.2
- light.Color = Color3.fromRGB(100, 50, 50)
- light.Range = 13
- part.Name = "something wicked this way comes..."
- local m = Instance.new("SpecialMesh",part)
- m.MeshId = "rbxassetid://9905413775"
- m.Scale = Vector3.new(0.5,0.5,0.5)
- local s = Instance.new("Sound",part)
- s.SoundId = "rbxassetid://7043921697"
- part.Transparency = 0.88
- local function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 70
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= model) then
- temp = temp2:findFirstChild("Head")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) and (temp2 ~= part:FindFirstAncestorWhichIsA("Model")) then
- if (temp.Position - pos).magnitude < dist then
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {temp2,part}
- raycastParams.IgnoreWater = true
- local result = workspace:Raycast(part.Position, CFrame.new(part.Position,temp.Position).lookVector * (part.Position - temp.Position).Magnitude, raycastParams)
- if not result then
- torso = temp
- mod = temp2
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- end
- return torso
- end
- local attack = false
- part.Touched:Connect(function(wha)
- if attack then
- if wha:FindFirstAncestorWhichIsA("Model") and wha:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid") then
- wha:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid").Health -= 10
- wha:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid").Sit = true
- pcall(function()
- coroutine.wrap(function()
- local rnd = Random.new()
- local bv = Instance.new("BodyVelocity", wha:FindFirstAncestorWhichIsA("Model").Head)
- bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bv.Velocity = (part.CFrame.upVector * -30) + Vector3.new(0, 30, 0)
- task.wait(.05)
- bv.MaxForce = Vector3.new()
- bv.Velocity = Vector3.new()
- wha:FindFirstAncestorWhichIsA("Model").Head.RotVelocity = Vector3.new(rnd:NextNumber(-5, 5), rnd:NextNumber(-5, 5), rnd:NextNumber(-5, 5))
- bv:Destroy()
- end)()
- end)
- attack = false
- end
- end
- end)
- -- 7, 12
- while wait(math.random(5,9)) do
- local torso = findNearestTorso(part.Position)
- if torso ~= nil then
- s.Pitch = 1 + (math.random(-5,5)/25)
- s:Play()
- 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)
- -- 3,4
- wait(math.random(3,4))
- attack = true
- part.Transparency = 0
- light.Brightness = 20
- 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)
- part.Position = part.Position - Vector3.new(0,1,0)
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
- local goal = {}
- 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)
- local tween = tweenService:Create(part, tweenInfo, goal)
- tween:Play()
- tween.Completed:Wait()
- attack = false
- s.Pitch = 3 + (math.random(-5,5)/25)
- s:Play()
- coroutine.wrap(function()
- for i = 1,20 do
- part.Transparency = 0.88 * (0.05 * i)
- light.Brightness = i
- wait()
- end
- end)()
- coroutine.wrap(function()
- for i = 10,0.2,-0.1 do
- light.Brightness = i
- task.wait()
- end
- end)()
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
- local goal = {}
- local x,y,z = CFrame.new(torso.Position,(torso.CFrame * CFrame.new(math.random(-50,50),0,math.random(-50,50))).Position):ToEulerAnglesXYZ()
- 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)
- local tween = tweenService:Create(part, tweenInfo, goal)
- tween:Play()
- else
- part.Transparency = 0
- light.Brightness = 10
- coroutine.wrap(function()
- for i = 1,20 do
- part.Transparency = 0.88 * (0.05 * i)
- light.Brightness = i
- wait()
- end
- end)()
- coroutine.wrap(function()
- for i = 10,0.2,-0.1 do
- light.Brightness = i
- task.wait()
- end
- end)()
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(0.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out)
- local goal = {}
- local x,y,z = CFrame.new(part.Position,(part.CFrame * CFrame.new(math.random(-50,50),math.random(-50,50),0)).Position):ToEulerAnglesXYZ()
- 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)
- local tween = tweenService:Create(part, tweenInfo, goal)
- tween:Play()
- s.Pitch = 3 + (math.random(-5,5)/25)
- s:Play()
- end
- end
- end)()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement