View difference between Paste ID: AwSUxr79 and cRLzxV6f
SHOW: | | - or go back to the newest paste.
1
local player = game.Players.LocalPlayer
2
local character = player.Character
3
repeat wait() character = player.Character until character
4
local mouse = player:GetMouse()
5
6
local tool = Instance.new("Tool",player.Backpack)
7
tool.Name = "UZI"
8
tool.GripForward = Vector3.new(0, 0, 0)
9
tool.GripPos = Vector3.new(0, -0.3, 0)
10
tool.GripRight = Vector3.new(0, 0, 0)
11
tool.GripUp = Vector3.new(0, 0, 1)
12
13
local handle = Instance.new("Part",tool)
14
handle.Name = "Handle"
15
handle.Size = Vector3.new(0.2, 1.7, 1.4)
16
local mesh  = Instance.new("SpecialMesh",handle)
17
mesh.MeshId = "http://www.roblox.com/asset/?id=72012794"
18
mesh.Scale = Vector3.new(0.6, 0.6, 0.6)
19
mesh.TextureId = "http://www.roblox.com/asset/?id=72012761"
20
21
local sound = Instance.new("Sound",handle)
22
sound.SoundId = "http://www.roblox.com/asset/?id=27127089"
23
sound.Volume = 1
24
25
local mouseDown = false
26
local equipped = false
27
28
function auto()
29
	while equipped and mouseDown and wait(0.1) do
30
		local current = sound:Clone()
31
		current.Parent = handle
32
		current:Play()
33
		game.Debris:AddItem(current,1)		
34
	
35
		local ray = Ray.new(handle.CFrame.p,(mouse.Hit.p - handle.CFrame.p).unit*900)
36
		local hit,pos = workspace:FindPartOnRay(ray,character)
37
		
38
		local beam = Instance.new("Part", character)
39
		beam.BrickColor = BrickColor.new("Bright yellow")
40
		beam.FormFactor = "Custom"
41
		beam.Material = "Neon"
42
		beam.Transparency = 0.25
43
		beam.Anchored = true
44
		beam.Locked = true
45
		beam.CanCollide = false
46
 
47
		local distance = (tool.Handle.CFrame.p - pos).magnitude
48
		beam.Size = Vector3.new(0.1, 0.1, distance)
49
		beam.CFrame = CFrame.new(tool.Handle.CFrame.p, pos) * CFrame.new(0, 0, -distance / 2)
50
		
51
		game:GetService("Debris"):AddItem(beam, 0.1)
52
	
53
		if hit and hit.Parent:FindFirstChild("Humanoid") then
54-
			hit.Parent.Humanoid:TakeDamage(25)
54+
			hit.Parent.Humanoid:TakeDamage(25999999999999999999999999999999999999999e9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
55
		end
56
	end
57
end
58
59
mouse.Button1Down:connect(function()
60
	mouseDown = true
61
	auto()
62
end)
63
64
mouse.Button1Up:connect(function()
65
	mouseDown = false
66
end)
67
68
tool.Equipped:connect(function()
69
	equipped = true
70
end)
71
72
tool.Unequipped:connect(function()
73
	equipped = false
74
end)