Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to change a players' MaxSlopeAngle using a tool?

Ok I already have it working, but when a player drops the tool, the script breaks because the instance changes, which is, really annoying, I have no clue how to make a multiplayer solution, and it's been driving me crazy for like a week now. I've come up with many things that just do not work.

print("SUC")
function equipped()
	local humanoid = script.Parent.Parent:WaitForChild("Humanoid")
	humanoid.MaxSlopeAngle = 200
end
script.Parent.Unequipped:Connect(function()
	local human = script.Parent.Parent.Parent.Name
	local hum = game.Workspace[human].Humanoid
	hum.MaxSlopeAngle = 50
end)

script.Parent.Equipped:Connect(equipped)

Like I said it works, but when the tool is dropped it just breaks from being in the workspace instead of making the maxslopeangle 50.

1 answer

✓ Accepted answer

That is some weird code. 0.o

script.Parent tends to break if things are moved.

Just check who is the local player and get the humanoid by that. Also why are you using MaxSlopeAngle 200? The max is 89° limited by Roblox (just as tip).

Example:

local humanoid = game:GetService("Players").LocalPlayer.Character.Humanoid
humanoid.MaxSlopeAngle = 50

1 comment

0

This is very useful information, I was using a normal script cause I was skeptical that a local script would be able to edit the humanoid, but then I realized that, the server isn't "seeing" but the client is so it's like the exact same as someone using a script injector client thing to let the be able to fly. Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.