I want to have a way in order to disable Rope Swinging while I’m Parachuting, and vise versa. My issue is, is that i have tried many ways and they usually just straight up don’t work and I’m not entirely sure why. I have tried remote events, Bindable events, just merging the two Scripts into one, etc, etc, but none of the solutions have worked for me since usually it breaks when i try.
This is my parachute code
humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Freefall then
wait(0.5)
if humanoid.FloorMaterial == Enum.Material.Air then
paraready = true
print("Parachute ready!")
end
end
if new == Enum.HumanoidStateType.Landed and chuting == true then
animtrack3:Play()
paraready = false
chuting = false
end
end)
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Space and paraready == true and chuting == false and alive == true then
local Para = Parachute:Clone()
Para.Parent = workspace
Para:SetPrimaryPartCFrame(root.CFrame + Vector3.new(0, -8, 0))
local Weld = Instance.new("Weld")
local orientation = root.Orientation
Weld.Parent = Para.PrimaryPart
Weld.Part0 = root
Weld.Part1 = Para.PrimaryPart
local WeldingCfr = root.CFrame --This is the world cframe where you want the bullet to be welded to
local ObjectCframe = root.CFrame:ToObjectSpace(WeldingCfr):Inverse()
Weld.C1 = ObjectCframe * CFrame.Angles(0,math.rad(180),0)
animtrack:Play()
root.AssemblyLinearVelocity = root.AssemblyLinearVelocity / 10
print("Parachuting!")
deploynoise:Play()
chuting = true
wait(0.5)
root.AssemblyLinearVelocity = root.AssemblyLinearVelocity / 5
if chuting == true then
animtrack2:Play()
end
while chuting == true do
wait(0.01)
root.AssemblyLinearVelocity = root.CFrame.LookVector * 30 + Vector3.new(0,-50,0)
end
if chuting == false then
Weld:Destroy()
Para.Union.FlyWeld:Destroy()
Para.Union.AssemblyLinearVelocity = root.CFrame.LookVector * -30
end
end
end)
humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
if humanoid.FloorMaterial ~= Enum.Material.Air then
animtrack:Stop()
animtrack2:Stop()
if chuting == true then
landingsound:Play()
end
paraready = false
chuting = false
end
end)
humanoid.Touched:Connect(function(hit)
if humanoid.FloorMaterial == Enum.Material.Air and hit.Transparency ~= 1 then
animtrack:Stop()
animtrack2:Stop()
if chuting == true then
landingsound:Play()
end
paraready = false
chuting = false
end
end)
character.Humanoid.Died:Connect(function()
animtrack:Stop()
animtrack2:Stop()
paraready = false
chuting = false
alive = false
end)
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.C then
animtrack:Stop()
animtrack2:Stop()
if chuting == true then
landingsound:Play()
end
paraready = false
chuting = false
end
end)
and this is my Rope Swing code
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Space and canSwing() then
local nearbyPart = getNearestPart()
if nearbyPart then
animtrack:Play()
wait(0.1)
connectRope(nearbyPart)
if swinging then
wait(0.8)
breakRope()
animtrack:Stop()
wait(0.01)
root.AssemblyLinearVelocity = camera.CFrame.LookVector * 110 + Vector3.new(0,50,0)
end
end
end
end)
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Space and swinging then
breakRope()
animtrack:Stop()
wait(0.01)
root.AssemblyLinearVelocity = camera.CFrame.LookVector * 110 + Vector3.new(0,50,0)
elseif input.KeyCode == Enum.KeyCode.C and swinging then
breakRope()
animtrack:Stop()
end
end)
while true do
wait(0.01)
if swinging then
root.AssemblyLinearVelocity = root.AssemblyLinearVelocity * 1.08
end
end
obviously some parts are missing, im just making it harder for lazy people to steal my code, but i left everything important that could be useful to anyone trying to help me. if anyone could help me, i would appreciate it very much!