The outcome you are getting (player dies) is because you are rotating all the parts individually which breaks their joints. You would need to rotate them all relative to one part.
script.Parent.Touched:connect(function(hit)
local h = hit.Parent:FindFirstChild('Humanoid')
if h then
h.Parent:SetPrimaryPartCFrame(h.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(-90),0))
end
end)
This should work. If it does not, research the SetPrimaryPartCFrame() function. Do not rely on SetPrimaryPartCFrame() in the future as it slowly will distort the model you are positioning.
5 comments
that just spins the character
that is what you said you are trying to do
no i needed it to rotate like upside down and sideways
hecking weeb used my exact code, just without getprimarypartcframe
when i typed my answer, yours wasn't even there, and yours gives no help at all showing what he did wrong. overall my post did a better job, please don't bring toxicity here