local char = owner.Character
local assets = LoadAssets(17372696578)
local handle = assets:Get("Handle")
local gui = assets:Get("Toolgun")
local handle2 = assets:Get("Handle2")
local wheelref = assets:Get("Wheel")
local thrustref = assets:Get("t")
local props = assets:Get("Props")
local equipped = false
local event = Instance.new("RemoteEvent")
local set = Instance.new("RemoteEvent")
local grab = Instance.new("RemoteEvent")
local tev = Instance.new("RemoteEvent")
local tool = Instance.new("Tool")
local physgun = Instance.new("Tool")
local currentprop = "Cube"
local cache = {}
local physbeam = handle2:FindFirstChildWhichIsA("Beam")
cache.Name = "ToolgunCache"
event.Name = "Fire"
set.Name = "SetProp"
set.Parent = tool
event.Parent = tool
wheelref.PrimaryPart = wheelref.Hinge
grab.Name = "Grab"
grab.Parent = physgun
tev.Name = "Thrusters"
tev.Parent = tool
local beamEnd = handle2.End
local thrusters = {}
local ballonref = Instance.new("Part")
ballonref.Shape = Enum.PartType.Ball
ballonref.Size = Vector3.new(2,2,2)
ballonref.Massless = true
ballonref.Transparency = 0.5
ballonref.TopSurface = Enum.SurfaceType.Smooth
ballonref.BottomSurface = Enum.SurfaceType.Smooth
local bp = Instance.new("BodyPosition")
bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
local att = Instance.new("Attachment",ballonref)
att.Position += Vector3.new(0,1,0)
local constraint = Instance.new("RopeConstraint",ballonref)
constraint.Visible = true
constraint.Attachment0 = att
constraint.Color = BrickColor.new("Institutional white")
constraint.Thickness += .02
local force = Instance.new("BodyForce")
force.Parent = ballonref
force.Force = Vector3.new(0,3500,0)
local sound = Instance.new("Sound")
sound.Parent = handle
sound.SoundId = "rbxassetid://7496207231"
sound.Volume = 1
local drop = Instance.new("Sound")
drop.Parent = handle2
drop.SoundId = "rbxassetid://8717291893"
drop.Volume = 2
local glow = Instance.new("Part")
glow.Parent = handle2
glow.Size = Vector3.new(1.219,0.883,0.883)
glow.Shape = Enum.PartType.Cylinder
glow.Material = Enum.Material.Neon
glow.Color = Color3.fromRGB(0, 170, 255)
glow.CFrame = handle2.CFrame * CFrame.new(-.3,-.1,.27) * CFrame.Angles(0,math.rad(90),0)
local w = Instance.new("WeldConstraint")
w.Parent = glow
w.Part0 = handle2
w.Part1 = glow
w.Enabled = true
spawn(function()
while wait() do
for i = 1,5 do
glow.Transparency += .1
wait(.1)
end
for i = 1,5 do
glow.Transparency -= .1
wait(.1)
end
end
end)
local hold = Instance.new("Sound")
hold.Parent = handle2
hold.SoundId = "rbxassetid://7449423195"
hold.Volume = 2
hold.Looped = true
tool.Name = "Toolgun"
tool.ToolTip = "pew pew now your welded to the baseplate"
tool.TextureId = "rbxassetid://11349822947"
tool.Grip = CFrame.new(0,-.6,.6)
physgun.Name = "Physgun"
physgun.ToolTip = "mmm soup"
physgun.TextureId = "rbxassetid://2832059044"
physgun.Grip = CFrame.new(-.5,-.6,-1.3) * CFrame.Angles(0,math.rad(200),0)
handle2.Name = "Handle"
handle2.Parent = physgun
handle.Parent = tool
handle.Size = Vector3.new(0.606,1.5,2.423)
tool.Parent = owner.Backpack
physgun.Parent = owner.Backpack
local weld1 = Instance.new("Weld")
local weld2 = Instance.new("Weld")
local start
for i,v in pairs(handle2:GetChildren()) do
if v:IsA("Attachment") then
if v.Name == "Beam" then
start = v
end
end
end
local light = Instance.new("PointLight")
light.Enabled = false
light.Parent = start
light.Color = Color3.new(0, 0.666667, 1)
light.Brightness = 10
light.Range = 10
weld1.Parent = char.Torso
weld2.Parent = char.Torso
weld1.Enabled = false
weld2.Enabled = false
weld1.Part0 = char.Torso["Right Shoulder"].Part0
weld1.Part1 = char.Torso["Right Shoulder"].Part1
weld2.Part0 = char.Torso["Left Shoulder"].Part0
weld2.Part1 = char.Torso["Left Shoulder"].Part1
weld1.C0 = char.Torso["Right Shoulder"].C0
weld1.C1 = char.Torso["Right Shoulder"].C1
weld2.C0 = char.Torso["Left Shoulder"].C0
weld2.C1 = char.Torso["Left Shoulder"].C1
weld1.C0 = weld1.C0 * CFrame.Angles(0,math.rad(20),math.rad(90))
weld2.C0 = CFrame.new(-.4,.6,-.4) * CFrame.Angles(0,math.rad(-130),math.rad(-90))
gui.Enabled = false
gui.Parent = owner.PlayerGui
tool.Destroying:Connect(function()
for i,v in pairs(cache) do
v:Destroy()
end
end)
local rope
local weld
local oldhit
set.OnServerEvent:Connect(function(player,prop)
currentprop = prop
end)
tev.OnServerEvent:Connect(function(player,dir,stop)
for i,v in pairs(thrusters) do
v.PrimaryPart.BodyForce.Force = v.PrimaryPart.CFrame.LookVector * 750 * dir
if not v then
table.remove(thrusters,thrusters[v])
end
end
end)
function newbeam(hit)
sound:Play()
local beam = Instance.new("Part")
beam.Parent = char
beam.Anchored = true
beam.CanCollide = false
beam.CFrame = CFrame.new(handle.Muzzle.WorldPosition,hit.Position) * CFrame.new(0, 0, -(handle.Muzzle.WorldPosition-hit.Position).Magnitude / 2)
beam.Size = Vector3.new(.1,.1,(handle.Muzzle.WorldPosition-hit.Position).Magnitude)
beam.BrickColor = BrickColor.new("Deep blue")
beam.Material = Enum.Material.Neon
beam.LocalTransparencyModifier = 0
spawn(function()
for i = 1,10,1 do
beam.Transparency += 0.1
beam.Size -= Vector3.new(.01,.01,0)
wait(0.025)
end
beam:Destroy()
end)
end
local obj
grab.OnServerEvent:Connect(function(player,hit,target,cameraCF,stop)
if not stop then
if obj then
if obj.Anchored == false then
obj:SetNetworkOwner(player)
if not hold.Playing then
hold:Play()
end
light.Enabled = true
beamEnd.Position = Vector3.new(0,0,0)
beamEnd.Parent = obj
physbeam.Enabled = true
bp.Parent = obj
bp.Position = cameraCF.Position + (hit.Position - cameraCF.Position).Unit * 20
end
else
obj = target
end
else
physbeam.Enabled = false
light.Enabled = false
beamEnd.Parent = handle2
if obj.Anchored == false and obj:FindFirstAncestor(workspace) then
obj:SetNetworkOwnershipAuto()
end
obj = nil
bp.Parent = nil
hold:Stop()
--pickup.Parent = handle2
if not drop.Playing then
drop:Play()
end
end
end)
event.OnServerEvent:Connect(function(player,hit,target,ended,mode,extra)
if mode == "rope" then
if ended then
newbeam(hit)
local attpart2 = Instance.new("Part")
attpart2.Anchored = false
attpart2.Transparency = 1
attpart2.Position = hit.Position
attpart2.CanCollide = false
attpart2.Size = Vector3.new(0,0,0)
if target.Name ~= "Base" then
attpart2.Parent = target
else
attpart2.Parent = workspace
end
local weld = Instance.new("WeldConstraint")
weld.Parent = attpart2
weld.Part0 = attpart2
weld.Part1 = target
weld.Enabled = true
local att2 = Instance.new("Attachment")
att2.Parent = attpart2
att2.WorldPosition = hit.Position
rope.Attachment1 = att2
rope.Visible = true
rope.Length = (oldhit.Position - hit.Position).Magnitude
table.insert(cache,rope)
table.insert(cache,attpart2)
table.insert(cache,weld)
else
newbeam(hit)
rope = Instance.new("RopeConstraint")
rope.Parent = target
local attpart1 = Instance.new("Part")
attpart1.Anchored = false
attpart1.Transparency = 1
attpart1.Position = hit.Position
attpart1.Size = Vector3.new(0,0,0)
attpart1.CanCollide = false
if target.Name ~= "Base" then
attpart1.Parent = target
else
attpart1.Parent = workspace
end
local weld = Instance.new("WeldConstraint")
weld.Parent = attpart1
weld.Part0 = attpart1
weld.Part1 = target
weld.Enabled = true
local att1 = Instance.new("Attachment")
att1.Parent = attpart1
att1.WorldPosition = hit.Position
rope.Attachment0 = att1
oldhit = hit
table.insert(cache,attpart1)
table.insert(cache,weld)
end
end
if mode == "weld" then
if ended then
newbeam(hit)
weld.Part1 = target
weld.Enabled = true
else
newbeam(hit)
weld = Instance.new("WeldConstraint")
weld.Parent = workspace
weld.Part0 = target
table.insert(cache,weld)
end
end
if mode == "wheel" then
if not ended then
newbeam(hit)
local wheel = wheelref:Clone()
local weld = Instance.new("WeldConstraint")
weld.Parent = wheel.Hinge
weld.Part0 = wheel.Hinge
weld.Part1 = target
weld.Enabled = false
local params = RaycastParams.new()
params.FilterDescendantsInstances = {char,wheel}
params.FilterType = Enum.RaycastFilterType.Exclude
wheel.PrimaryPart.CFrame = CFrame.new(hit.Position)
wheel.Wheel.CFrame = CFrame.new(hit.Position)
local unit = extra[1]
local result = workspace:Raycast(unit.Origin,unit.Direction * 1000,params)
local normal = result.Normal
wheel.PrimaryPart.CFrame = CFrame.new(hit.Position,hit.Position + normal)
wheel.Parent = workspace
weld.Enabled = true
table.insert(cache,wheel)
end
end
if mode == "thruster" then
if not ended then
newbeam(hit)
local thruster = thrustref:Clone()
local weld = Instance.new("WeldConstraint")
weld.Parent = thruster
weld.Part0 = thruster.PrimaryPart
weld.Part1 = target
weld.Enabled = false
local params = RaycastParams.new()
params.FilterDescendantsInstances = {char,thruster}
params.FilterType = Enum.RaycastFilterType.Exclude
thruster.PrimaryPart.CFrame = CFrame.new(hit.Position)
local unit = extra[1]
local result = workspace:Raycast(unit.Origin,unit.Direction * 1000,params)
local normal = result.Normal
thruster.PrimaryPart.CFrame = CFrame.new(hit.Position,hit.Position + normal) * CFrame.Angles(math.rad(-90),0,0)
thruster.Parent = workspace
weld.Enabled = true
table.insert(thrusters,thruster)
table.insert(cache,thruster)
end
end
if mode == "balloon" then
if not ended then
newbeam(hit)
local balloon = ballonref:Clone()
balloon.CFrame = hit
if target.Name ~= "Base" then
balloon.Parent = target
else
balloon.Parent = workspace
end
local tag = Instance.new("StringValue")
tag.Name = "CreatorProp"
tag.Parent = balloon
local attpart1 = Instance.new("Part")
attpart1.Anchored = false
attpart1.Transparency = 1
attpart1.Position = hit.Position
attpart1.CanCollide = false
attpart1.Size = Vector3.new(0,0,0)
if target.Name ~= "Base" then
attpart1.Parent = target
else
attpart1.Parent = workspace
end
local weld = Instance.new("WeldConstraint")
weld.Parent = attpart1
weld.Part0 = attpart1
weld.Part1 = target
weld.Enabled = true
local att1 = Instance.new("Attachment")
att1.Parent = attpart1
att1.WorldPosition = hit.Position
balloon.RopeConstraint.Attachment1 = att1
balloon.BrickColor = BrickColor.random()
table.insert(cache,balloon)
table.insert(cache,attpart1)
end
end
if mode == "creator" then
if not ended then
newbeam(hit)
local prop = props:FindFirstChild(currentprop)
prop = prop:Clone()
prop.Parent = workspace
local tag = Instance.new("StringValue")
tag.Name = "CreatorProp"
tag.Parent = prop
if prop:IsA("Model") then
prop.PrimaryPart.CFrame = CFrame.new(hit.Position)
for i,v in pairs(prop:GetChildren()) do
if v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("UnionOperation") then
v.Anchored = false
v.CanCollide = true
end
end
else
prop.Position = hit.Position
prop.Anchored = false
prop.CanCollide = true
end
table.insert(cache,prop)
end
end
if mode == "remover" then
if not ended then
newbeam(hit)
if target then
if target:FindFirstChild("CreatorProp") then
target:Destroy()
end
end
end
end
end)
local rarm = char.Torso["Right Shoulder"]
local larm = char.Torso["Left Shoulder"]
physgun.Equipped:Connect(function()
rarm.Enabled = false
larm.Enabled = false
weld1.Enabled = true
weld2.Enabled = true
end)
physgun.Unequipped:Connect(function()
rarm.Enabled = true
larm.Enabled = true
weld1.Enabled = false
weld2.Enabled = false
end)
NLS([[
local tool = game.Players.LocalPlayer.Backpack:FindFirstChild("Toolgun") or game.Players.LocalPlayer.Character:FindFirstChild("Toolgun")
local physgun = game.Players.LocalPlayer.Backpack:FindFirstChild("Physgun") or game.Players.LocalPlayer.Character:FindFirstChild("Physgun")
local event = tool.Fire
local mouse = game.Players.LocalPlayer:GetMouse()
local currentmode = "rope"
local equipped = false
local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local run = game:GetService("RunService")
local gui = player.PlayerGui.Toolgun
local holding = false
local tev = tool.Thrusters
local modes = {
"rope",
"weld",
"balloon",
"creator",
"remover",
"wheel",
"thruster"
}
gui.Mode.Position = UDim2.new(0.5,0,0.805,0)
for i,v in pairs(gui.Spawn.ScrollingFrame:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
tool.SetProp:FireServer(v.Name)
end)
end
end
tool.Equipped:Connect(function()
equipped = true
gui.Enabled = true
gui.Spawn.Visible = false
gui.Mode.Text = "<Q "..currentmode.." E>"
end)
physgun.Activated:Connect(function()
holding = true
end)
physgun.Deactivated:Connect(function()
holding = false
physgun.Grab:FireServer(mouse.Hit,mouse.Target,workspace.CurrentCamera.CFrame,true)
end)
tool.Unequipped:Connect(function()
equipped = false
gui.Enabled = false
end)
mouse.Button1Down:Connect(function()
if equipped then
event:FireServer(mouse.Hit,mouse.Target,false,currentmode,{mouse.UnitRay})
end
end)
mouse.Button1Up:Connect(function()
if equipped then
event:FireServer(mouse.Hit,mouse.Target,true,currentmode,{mouse.UnitRay})
end
end)
uis.InputBegan:Connect(function(input,busy)
if not busy then
if input.KeyCode == Enum.KeyCode.T then
tev:FireServer(1)
end
if input.KeyCode == Enum.KeyCode.Y then
tev:FireServer(-1)
end
if input.KeyCode == Enum.KeyCode.E then
local max = #modes
local current = table.find(modes,currentmode)
local nr = current + 1
if nr > max then
nr = 1
end
currentmode = modes[nr]
gui.Mode.Text = "<Q "..currentmode.." E>"
end
if input.KeyCode == Enum.KeyCode.Q then
local max = #modes
local current = table.find(modes,currentmode)
local nr = current - 1
if nr < 1 then
nr = max
end
currentmode = modes[nr]
gui.Mode.Text = "<Q "..currentmode.." E>"
end
if input.KeyCode == Enum.KeyCode.R then
gui.Spawn.Visible = true
end
end
end)
uis.InputEnded:Connect(function(input,busy)
if not busy then
if input.KeyCode == Enum.KeyCode.R then
gui.Spawn.Visible = false
end
if input.KeyCode == Enum.KeyCode.T then
tev:FireServer(0)
end
if input.KeyCode == Enum.KeyCode.Y then
tev:FireServer(0)
end
end
end)
run.RenderStepped:Connect(function()
if holding then
physgun.Grab:FireServer(mouse.Hit,mouse.Target,workspace.CurrentCamera.CFrame,false)
end
end)
]])