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.