View difference between Paste ID: QdKYcPDk and NDX7H1WX
SHOW: | | - or go back to the newest paste.
1
wait()
2
script.Parent=nil
3
function Fire(cframee)
4
local part = Instance.new("Part", game.Players.LocalPlayer.Character)
5
part.FormFactor = Enum.FormFactor.Symmetric
6
part.CanCollide = false
7
part.Anchored = true
8
part.Material = Enum.Material.Neon
9
part.Size = Vector3.new(8, 1, 1)
10
part.Locked = true
11
part.BrickColor = BrickColor.new("Institutional white")
12
part.Friction = 0.3
13
part.CFrame=cframee
14
while part and part.Parent~=nil do
15
local ray = Ray.new(
16
    part.CFrame.p,
17
    (part.CFrame*CFrame.new(1,0,0).p - part.CFrame.p).unit * 4
18
) 
19
local ignore = game.Players.LocalPlayer.Character
20
 
21
local hit, position, normal = Workspace:FindPartOnRay(ray, ignore)
22
if hit then
23
part.CFrame=part.CFrame*CFrame.Angles(0,math.rad(math.random(-360,360)),0)
24
pcall(function()hit.Parent.Humanoid:TakeDamage(30)end)
25
pcall(function()hit.Parent.Parent.Humanoid:TakeDamage(30)end)
26
else
27
part.CFrame=part.CFrame*CFrame.new(4,0,0)
28
end
29
game:service'RunService'.RenderStepped:wait()
30
end
31
end
32
game:service'Players'.LocalPlayer:GetMouse().KeyDown:connect(function(key)
33
if key=='e' then
34
Fire(game.Players.LocalPlayer.Character.Head.CFrame*CFrame.new(0,0,-4)*CFrame.Angles(0,math.rad(90),0))
35
elseif key == 'q' then
36
for i=1, 36 do
37
coroutine.resume(coroutine.create(function()
38
Fire(game.Players.LocalPlayer.Character.Head.CFrame*CFrame.Angles(0,math.rad(i*10),0)*CFrame.new(0,0,-4)*CFrame.Angles(0,math.rad(90),0))
39
end))
40
end
41
end
42
end)