#Problem with setting AutoRotate

54 messages · Page 1 of 1 (latest)

fallen anchor
#

I am making command script and decided to make option to change AutoRotate(in humanoid). I tried debug(It runs whole script) and no errors. Anyone know reason why its happening?

#
local char = Player.Character

            if char then
                local succ, err = pcall(function()
                    char.Humanoid.AutoRotate = Parametrs[2]
                end)

                if not succ then
                    return err
                end
            end
#

Parametrs[2] is string(true/false) or number(0/1)

strange minnow
fallen anchor
#

cuz its chat command

#

Paramters is table of strings

strange minnow
#

Isn’t autorotade a bool?

fallen anchor
#

yes

#

but it should trow error

strange minnow
#

Why not ToBool it

fallen anchor
#

if it wouldnt accept string

#

There is ToBool thing in roblox?

strange minnow
#

We have to loop a script to make it so certain parts of the body stay visible in first person

fallen anchor
#

uh

strange minnow
#

Also, why return the error code?

fallen anchor
#

cuz I made my own error handling

rancid flame
#

can any of you help me with this game

fallen anchor
#

so admin could see error

#
  • I have webhook saving
#

so if errors accour it auto send to discord

#

so I could repair it later

strange minnow
#

xpcall has some warning customisation, maybe look into that

#

Anyways, does it return err or return nothing?

fallen anchor
#

it returns nothing

#

as I said I've run debug

#

and everything worked

#

no errors

fallen anchor
#

it didnt worked

#

but every line were executed

strange minnow
#

Well pcall doesn’t give a normal error unless you print errr. (Or read it some other way)

fallen anchor
#

I print errors

#

rn

strange minnow
#

Hmh

fallen anchor
#

it could be roblox studio error

strange minnow
#

Most likely not. Maybe try to change it manually and see if it works with a normal string

#

so use the commandbar and type
game.Players.(yourname).Character.Humanoid.AutoRotate = “false”

fallen anchor
#

yh string and numbers doesnt work

strange minnow
#

Use ToBool (or however you spell it)

fallen anchor
#

there is no to bool function

strange minnow
#

hang on

fallen anchor
#

I could create my own

strange minnow
#

I swore toboolean was in luau as well

#

Had to google the full name, can’t find any luau sources on it

fallen anchor
#

Made my own function

#

it works rn

#

Thanks for help

strange minnow
#

function tobool(v)
return v and ( (type(v)=="number") and (v==1) or ( (type(v)=="string") and (v=="true") ) )
end
A function to change it manially

strange minnow
fallen anchor
#

yep

#

Aiming for 3

#

or higher

#

if u meant rank