Hey, guys.
I'm making a 3DMG from Attack on Titan, however it seems that my script is not working. I've scattered prints all over it and it seems that it won't come out of the repeat loop properly when the key comes up. Here's my script: Player = game.Players.LocalPlayer Mouse = Player:GetMouse() Torso = Player.Character.Torso UpdateGrapple = false Speed = 50 debounce = false
function Grapple(Location, MTar)
if MTar == nil then return end
Player.Character.Humanoid.Died:connect(function ()
Container:Destroy()
if Torso:FindFirstChild("RocketPropulsion") ~= nil then
Torso.RocketPropulsion:Destroy()
end
end)
Container = Instance.new("Model", game.Workspace)
Container.Name = Player.Name.."Container"
print("Firing grapple!")
loc = Location.p
distance = (loc - Torso.Position).magnitude
print("Defined variables")
Target = Instance.new("Part", Container)
Target.Name = Player.Name.."Target"
Target.Transparency = 0
Target.Anchored = false
print("Made target")
W = Instance.new("ManualWeld", Target)
W.Part0 = Target
W.Part1 = MTar
W.C0 = CFrame.new()
W.C1 = MTar.CFrame-MTar.CFrame.p
print("Welded target")
Target.CFrame = Location
RP = Instance.new("RocketPropulsion", Player.Character.Torso)
RP.CartoonFactor = 1
RP.Target = Target
RP.MaxThrust = 10000
RP.MaxTorque = Vector3.new(3000, 3000, 3000)
RP.MaxSpeed = Speed
RP:Fire()
print("Made and fired RP. Starting the wire sequence")
repeat
Wire = Instance.new("Part", Container)
Wire.Name = Player.Name.."Wire"
Wire.BrickColor = BrickColor.new("Really black")
Wire.Transparency = 0
Wire.Anchored = true
Wire.CanCollide = false
Wire.TopSurface = Enum.SurfaceType.Smooth
Wire.BottomSurface = Enum.SurfaceType.Smooth
Wire.formFactor = Enum.FormFactor.Custom
distance = (loc - Torso.Position).magnitude
Wire.Size = Vector3.new(0.2, 0.2, distance)
Wire.CFrame = CFrame.new(loc, Torso.CFrame.p) * CFrame.new(0, 0, -distance/2)
wait()
Wire:Destroy()
until UpdateGrapple == false
print("Wire sequence ended.")
print("Unlatched!")
Container:Destroy()
RP:Destroy()
end
Mouse.KeyDown:connect(function (Key)
if Key == "q" then
UpdateGrapple = true
Grapple(Mouse.hit, Mouse.Target)
print("Latched!")
Mouse.KeyUp:connect(function (Key)
if Key == "q" then
UpdateGrapple = false
print("UpdateGrapple been set to false")
end
end)
end
end)
Basically you press Q, it shoots the wire and activates the RocketPropulsion object to send you towards the desired point, and starts updating the wire in real time so it looks like you're reeling it in. When the player releases Q, the requirement to stop the loop is met and it stops updating and deletes everything. Any help appreciated.

1 comment
Actually, you accidentally fixed the issue in the process of fixing this one. I see now that it doesn't need to be inside the other function, because it cannot go up without going down first. Thank you!