Trying to make a climbing tool

I’d like to make a tool that allows the player to climb 90º walls as if they were trusses or slopes, however, the “MaxSlopeAngle”, which I meant to modify directly from the player’s humanoid, is locked at a maximum of 89.9º. It was going to be very simple, but this limit enforced by the Studio simply destroyed any chances of doing the “climb tool” the way I was thinking of doing it.

There is probably a solution involving plenty of code, but I’m still quite bad at coding and I don’t have any idea on how I could make the tool work. So, I came here to ask if anyone knows an alternative. Or maybe, even find a way to get around this limit so I could do the script much easily.

Here is the code, nothing really interesting, plus I am not its original creator.

local Tool = script.Parent

local Resources = require(script.Parent:WaitForChild("Resources"))
local RemoteEventCreator = require(Resources:GetResource("RemoteEventCreator"))
local Configuration = require(script.Parent.Resources:WaitForChild("Configuration"))

local WALK_SPEED_BUFF = Configuration.WALK_SPEED_BUFF

local CurrentPlayer,CurrentCharacter,CurrentHumanoid
local Equipped = false
local ToolEnabled = true

--Set up the equip and unequip events.
Tool.Equipped:Connect(function()
	if not Equipped then
		Equipped = true
		
		--Set the current player.
		CurrentCharacter = Tool.Parent
		CurrentHumanoid = CurrentCharacter:FindFirstChildOfClass("Humanoid")
		CurrentPlayer = game.Players:GetPlayerFromCharacter(CurrentCharacter)
		
		--Add the modifiers.
		CurrentHumanoid.WalkSpeed = CurrentHumanoid.WalkSpeed + WALK_SPEED_BUFF
		CurrentHumanoid.MaxSlopeAngle = 90
		delay(0.55, function()
			if not Equipped then return end
		end)
	end
end)

Tool.Unequipped:Connect(function()
	if Equipped then
		Equipped = false
		
		--Remove the modifiers.
		CurrentHumanoid.WalkSpeed = CurrentHumanoid.WalkSpeed - WALK_SPEED_BUFF
		CurrentHumanoid.MaxSlopeAngle = 70 -- This is the default MSA from the game.
		
		--Reset the current character.
		CurrentCharacter = nil
		CurrentHumanoid = nil
		CurrentPlayer = nil
	end
end)

As you can see, I have modified a simple tool script to add the effects upon the humanoid. However, the “CurrentHumanoid.MaxSlopeAngle = 90” part does not work due to the limit set upon the MaxSlopeAngle value.

I’d appreciate any help with the topic.

1 Like

I don’t know if bumping is against the rules, but I’ll do it once. I have not found any kind of solution or way to create the climbing tool, and I don’t think I will at this point, which is why I have resorted to the developer forum. But, in case no one shows up, I guess I’d just have to abandon the idea and carry on. No hard feelings.

So I kinda made it but like its hard to explain, here is the game:

I made this in a few minutes and I also didnt know what you really wanted

Play its so I can show you

I was thinking about a similar kind of script involving a truss being spawned in front of the player, but I didn’t think it would actually work. I think that adding a raycast system to detect if there’s a wall in front of the player would make it perfect.

All I need is to know how to script these, especially the raycast. Are there any articles that could be helpful with making this system?

Yeah thats exactly what I was thinking for detecting if they are infront of a wall.

Also I made the game uncopy locked.

For the ray casting, B Ricey made a video on the new ray casting which is much better than the old one:

Thank you so much dude, I didn’t expect anyone to help me out with this.

1 Like

I updated the game and added some raycasting to detect if the player is facing a wall. I also thought of sizing the Y axis of the truss part to the size of the Y axis of the wall they are facing, it works but you will have to see which on you like, both are in the game.