Need Help Flipping An Item Over In Replicated Storage

So I have admin commands I made in my game. One of them is ;boxtrap me and it traps you in a box but I want that box to be flipped over. One thing i tried was flipping it over before adding it into the replicated storage, but that didn’t work. can anyone help? Thanks!
robloxapp-20210323-1416582_Trim.wmv

post this in #help-and-feedback:scripting-support

function FlipBox(Box)
      Box.Orientation = Box.Orientation + Vector3.new(0, 180, 0)
end

change the 180 to -180 if it doesn’t work

ok i will try that. also sorry about posting it in game design i wasnt sure

yeah, I haven’t tested that. (By the way make sure the box is a part or union or meshPart, not a model.)

so the part is a mesh and i should work but it didn’t. should i add this in a script in the meshpart?
because that is what i did

let me try doing the -180 instead of 180

So basically do
FlipBox(script.Parent) if the script is in a meshpart

so .Parent) says their is an error :thinking:

and yes the script is inside a meshpart

You will need to set the parts CFrame. If it is a model change the PrimaryPart CFrame.

CFrame.Angles is used for rotations, however it’s parameters are taken in radians not degrees. You can use math.rad(degree) to convert a degree to a radian (you can use math.deg(radian) to convert a radian to a degree).

Part.CFrame = Part.CFrame * CFrame.Angles(math.rad(90), 0, 0) This code will rotate the part 90 degrees on its X axis.

2 Likes

so i think we would also need to add
local Part = game.ReplicatedStorage.Box

All I did was provide an example of how Angles works. Edit what I provided to work with your code, don’t come here expecting people to just fix your code for you.

1 Like

ok i wasn’t so sure so let me mess around with it.

thanks @Mysterious_Myth11 this was helpful!

Yeah this video also helped me a ton.

i was nice but i still could not get things to work. He was using the wockspace

1 Like

Can you show us pictures of the box, and the Orientation property of the box?