Help with non-tool-based grappling hook

I’ve been trying to make a grappling hook but I don’t want it to be an item, I want the grappling hook to work when you press a button perhaps, F on the keyboard, I’ve been looking to make this for quite a while, such a thing is being currently used in super cube cavern (super cube cavern is a game). Thanks for reading bye.

First you’d start off by using UserinputService to detect input from keyboard

 local UserInputService = game:GetService("UserInputService")
       UserInputService.InputBegan:Connect(function(input, gameProcessed)
       	if  gameProcessed== true then return end
       	if input.KeyCode == Enum.KeyCode.F then
       		--// Shoot Grapling hook then wait() then run a tween to make the wire shorter
       	end
       end)

for your grappling hook

  1. I assume you have a grappling hook because you want it Non-tool-based you will most likely need to weld it to the player hand I recommend using Moto6ds great for animating

[ Heres a resource that teaches u how to setup motor6ds to animate it says its for tools but i hope u will repropose it to be Non-tool-based -Link ]

  1. you could make the rope out of RopeConstraints and tween the rope to get shorter
function ConnectGrapplingHook()

game.ReplicatedStorage.ConnectM6D:FireServer(Hand) --// Mock Remote event u will need a remote to weld it serverside 
	--// Playan animaiton after u weld if desired
end

function disonnectGrapplingHook() --// a function to disconnect grappling hook weld
end

local TweenService = game:GetService("TweenService")

function FireGrapplingHook()
	--// Tween to Shoot wire when function fired
end

function RetractWire()
--// Tween to retract wire whenfunction fired
end

Please note: the functions above are placeholders/examples and will not anything

I think this is an okay start :hatching_chick:

1 Like