local K=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")K.MouseIconEnabled=false repeat wait()until game.Players.LocalPlayer.Character local V=game.Players.LocalPlayer:GetMouse()local S=game.Players.LocalPlayer.Character local e=require(script.Parent.Marching)local I=Instance.new("\080\111\105\110\116\076\105\103\104\116",S.HumanoidRootPart)I.Color=Color3.new(.5,.5,.9)I.Range=15 I.Brightness=.35 local function X(K,S,e,I)local X=Instance.new("\080\097\114\116",workspace)X.Shape="\066\097\108\108"X.Size=Vector3.new(1.5,1.5,1.5)X.TopSurface=0 X.BottomSurface=0 X.Color=Color3.fromHSV((Random.new()):NextNumber(0,1),.9,.9)X.Material="\078\101\111\110"X.CFrame=CFrame.new(K)X.CanCollide=false X.Velocity=(V.Hit.p-K).unit*S local W=Instance.new("\080\111\105\110\116\076\105\103\104\116",X)W.Color=X.Color W.Range=e wait()X.CanCollide=true if I then X.Touched:connect(function()X.Anchored=true end)end end local W local T=false K.InputBegan:connect(function(K)local I=game.Players.LocalPlayer.Character local v=(I.HumanoidRootPart.CFrame*CFrame.new(0,3,0)).p if K.KeyCode==Enum.KeyCode.E then X(v,180,30,false)elseif K.KeyCode==Enum.KeyCode.Q then X(v,360,60,true)elseif K.KeyCode==Enum.KeyCode.Space and W then W:Destroy()W=nil T=false elseif K.KeyCode==Enum.KeyCode.G and not W then local K=Instance.new("\065\116\116\097\099\104\109\101\110\116",S.HumanoidRootPart)local e=Instance.new("\065\116\116\097\099\104\109\101\110\116",workspace.Terrain)e.Position=V.Hit.p W=Instance.new("\082\111\112\101\067\111\110\115\116\114\097\105\110\116",S)W.Length=(K.WorldPosition-e.WorldPosition).magnitude+1 W.Attachment0=e W.Attachment1=K W.Visible=true elseif K.UserInputType==Enum.UserInputType.MouseButton2 then T=true elseif K.UserInputType==Enum.UserInputType.MouseButton1 then e(V.Hit.p,1)end end)K.InputEnded:connect(function(K)if K.UserInputType==Enum.UserInputType.MouseButton2 then T=false end end);(game:GetService("\082\117\110\083\101\114\118\105\099\101")).Heartbeat:connect(function()if W and(W.Length>5 and T)then W.Length=W.Length-.15 end end)
--horrible demo code for throwing lights, digging, and grappling
local UIS = game:GetService("UserInputService")
UIS.MouseIconEnabled = false

repeat wait() until game.Players.LocalPlayer.Character 

local Mouse = game.Players.LocalPlayer:GetMouse()
local Character = game.Players.LocalPlayer.Character

local explode = require(script.Parent.Marching)

local light = Instance.new("PointLight", Character.HumanoidRootPart)
light.Color = Color3.new(0.5, 0.5, 0.9)
light.Range = 15
light.Brightness = 0.35

local function fireProjectile(start, velocity, range, stopOnTouch)
	local projectile = Instance.new("Part", workspace)
	projectile.Shape = "Ball"
	projectile.Size = Vector3.new(1.5, 1.5, 1.5)
	projectile.TopSurface = 0
	projectile.BottomSurface = 0
	projectile.Color = Color3.fromHSV(Random.new():NextNumber(0,1), 0.9, 0.9)
	projectile.Material = "Neon"
	projectile.CFrame = CFrame.new(start)
	projectile.CanCollide = false
	projectile.Velocity = (Mouse.Hit.p-start).unit*velocity
	
	local light = Instance.new("PointLight", projectile)
	light.Color = projectile.Color
	light.Range = range
	
	wait()
	
	projectile.CanCollide = true
	
	if stopOnTouch then
		projectile.Touched:connect(function()
			projectile.Anchored = true
		end)
	end
end

local rope
local shouldReel = false

UIS.InputBegan:connect(function(input)
	local character = game.Players.LocalPlayer.Character
	local start = (character.HumanoidRootPart.CFrame * CFrame.new(0, 3, 0)).p
		
	if input.KeyCode == Enum.KeyCode.E then
		fireProjectile(start, 180, 30, false)
	elseif input.KeyCode == Enum.KeyCode.Q then
		fireProjectile(start, 360, 60, true)
	elseif input.KeyCode == Enum.KeyCode.Space and rope then
		rope:Destroy()
		rope = nil
		shouldReel = false
	elseif input.KeyCode == Enum.KeyCode.G and not rope then
		local a1 = Instance.new("Attachment", Character.HumanoidRootPart)
		local a2 = Instance.new("Attachment", workspace.Terrain)
		a2.Position = Mouse.Hit.p
		
		rope = Instance.new("RopeConstraint", Character)
		rope.Length = (a1.WorldPosition-a2.WorldPosition).magnitude+1
		rope.Attachment0 = a2
		rope.Attachment1 = a1
		rope.Visible = true
		
	elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
		shouldReel = true
	elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
		explode(Mouse.Hit.p, 1)
	end
end)

UIS.InputEnded:connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton2 then
		shouldReel = false
	end
end)

game:GetService("RunService").Heartbeat:connect(function()
	if rope and rope.Length > 5 and shouldReel then
		rope.Length = rope.Length - 0.15
	end
end)
