Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change a players' MaxSlopeAngle using a tool?

Asked by 1 year ago

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

Log in to vote
0
Answered by
xXMadonXx 190
1 year ago
Edited 1 year ago

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
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! oXDestroyerXo 28 — 1y
Ad

Answer this question