Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I made this script that shoots two long bricks from your arms , can someone explain whats wrong?

Asked by 10 years ago
It makes arms extend to where ever your mouse clicked, and its in a tool not a hopperbin I tried as a script and a local script. It works fine in test mode but not online.

---------------------script below-----------------------

bin = script.Parent
Backpack = bin.Parent
me = Backpack.Parent
Character = me.Character
torso = Character.Torso
rightarm = Character["Right Arm"]
leftarm = Character["Left Arm"]
rightleg = Character["Right Leg"]
leftleg = Character["Left Leg"]
LeftShoulder = torso["Left Shoulder"]
RightShoulder = torso["Right Shoulder"]
LeftHip = torso["Left Hip"]
RightHip = torso["Right Hip"]
Neck = torso["Neck"]
RightShoulderC0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
LeftShoulderC0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
LeftHipC0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
RightHipC0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
local mouse = me:GetMouse()

function null()
RightShoulder.C0 = RightShoulderC0
LeftShoulder.C0 = LeftShoulderC0
RightHip.C0 = RightHipC0
LeftHip.C0 = LeftHipC0
end

local COOLDOWN = 1.5




r = game:service("RunService")


MAX_VELOCITY  = 180
MIN_VELOCITY  = 20

PULLBACK_TIME = 0

wait(0.1)



function computeDirection(vec)
    local lenSquared = vec.magnitude * vec.magnitude
    local invSqrt = 1 / math.sqrt(lenSquared)
    return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end

function onAci(mouse)
    local pos = mouse.Hit.p
    pos1 = rightarm.Position
if (torso.Position-pos).magnitude <= 22250 then
local Arrow = Instance.new("Part")
Arrow.Locked = true
Arrow.CanCollide = false
Arrow.BackSurface = 0
Arrow.BottomSurface = 0
Arrow.FrontSurface = 0
Arrow.LeftSurface = 0
Arrow.RightSurface = 0
Arrow.Name = "Blast"
Arrow.TopSurface = 0
Arrow.formFactor = "Symmetric"
Arrow.Shape = "Block"
Arrow.Material = "Plastic"
Arrow.Size = Vector3.new(2, 2, 1)
Arrow.BrickColor = BrickColor.new("Bright red")
Arrow.CFrame = rightarm.CFrame
Arrow.Anchored = true
Owner = Instance.new("ObjectValue")
Owner.Parent = Arrow
Owner.Name = "Owner"
Owner.Value = me
Arrow.Parent = Character
f = script.ArrowScript:clone()
f.Parent = Arrow
f.Disabled = false
local Arrow2 = Instance.new("Part")
Arrow2.Locked = true
Arrow2.CanCollide = false
Arrow2.BackSurface = 0
Arrow2.BottomSurface = 0
Arrow2.FrontSurface = 0
Arrow2.LeftSurface = 0
Arrow2.RightSurface = 0
Arrow2.Name = "Blast"
Arrow2.TopSurface = 0
Arrow2.formFactor = "Symmetric"
Arrow2.Shape = "Block"
Arrow2.Material = "Plastic"
Arrow2.Size = Vector3.new(2, 2, 1)
Arrow2.BrickColor = BrickColor.new("Bright red")
Arrow2.CFrame = rightarm.CFrame
Arrow2.Anchored = true
Owner = Instance.new("ObjectValue")
Owner.Parent = Arrow2
Owner.Name = "Owner"
Owner.Value = me
Arrow2.Parent = Character
g = script.ArrowScript:clone()
g.Parent = Arrow2
g.Disabled = false
RightShoulder.C0 = RightShoulderC0 * CFrame.Angles(0, 0, 1.5)
LeftShoulder.C0 = LeftShoulderC0 * CFrame.Angles(0, 0, -1.5)
rightarm.Transparency = 1
leftarm.Transparency = 1
for i = 1,(pos1-pos).magnitude/4 do 
Arrow.Size = Vector3.new(0, 0, i*4)
Arrow2.Size = Vector3.new(0, 0, i*4)
Arrow2.CFrame = torso.CFrame * CFrame.new(-1.5, 0.6, 0-i*2)
Arrow.CFrame = torso.CFrame * CFrame.new(1.5, 0.6, 0-i*2)
for u, c in pairs(workspace:GetChildren()) do
if c.Name ~= me.Name then
h = c:findFirstChild("Humanoid")
t = c:findFirstChild("Torso")
if h ~= nil and t ~= nil then
if (Arrow.Position-t.Position).magnitude <= 10 or (Arrow2.Position-t.Position).magnitude <= 10 then
h.Health = h.Health - 2.5
if (torso.Position-pos).magnitude <= 50 then
t.Velocity = torso.CFrame.lookVector * 190 + Vector3.new(0, 80, 0)
h.Sit = true
end
end
end
end
end
wait(.001)
end
continue1 = Arrow.Size
continue2 = Arrow.CFrame
continue3 = Arrow2.Size
continue4 = Arrow2.CFrame
pos2 = (pos1-pos).magnitude
torso.Anchored = true
for i = 1,(pos1-pos).magnitude/4 do 
Arrow.Size = continue1 + Vector3.new(0, 0, 0-i*4)
Arrow2.Size = continue3 + Vector3.new(0, 0, 0-i*4)
Arrow2.CFrame = continue4 * CFrame.new(0, 0, 0+i*2)
Arrow.CFrame = continue2 * CFrame.new(0, 0, 0+i*2)
for u, c in pairs(workspace:GetChildren()) do
if c.Name ~= me.Name then
h = c:findFirstChild("Humanoid")
t = c:findFirstChild("Torso")
if h ~= nil and t ~= nil then
if (Arrow.Position-t.Position).magnitude <= 10 or (Arrow2.Position-t.Position).magnitude <= 10 then
h.Health = h.Health - 2.5
if (torso.Position-pos).magnitude <= 50 then
t.Velocity = torso.CFrame.lookVector * 190 + Vector3.new(0, 80, 0)
h.Sit = true
end
end
end
end
end
wait(.001)
end
end
null()
rightarm.Transparency = 0
leftarm.Transparency = 0
torso.Anchored = false
 end
script.Parent.Activated:connect(function() onAci(mouse) end)
    --[[mouse.Button1Down:connect(function() onButton1Down(mouse) end)]]--

also, the mouse.Button1Down:connect(function() onButton1Down(mouse) end) was for a previous function title for hopperbin I removed.

1 answer

Log in to vote
-2
Answered by 10 years ago

Hopperbins broke Don't know why. At the time you have to use premade hopperbins

0
Hopperbins are NOT broken. I use them all the time. DiamondBladee 135 — 10y
0
Is there a way to make the script work on a tool? I switched it too a tool , but in test it works, not online. darkunite43 15 — 10y
0
I also put this into Stickmasterlukes premade hopperbin, and it didnt work online darkunite43 15 — 10y
0
Diamond and dark, The premade hopperbins are in their properties and Diamond, not anymore. fireboltofdeath 635 — 10y
Ad

Answer this question