Answered by
5 years ago Edited 5 years ago
Well this was fun (and amusing) to work on, and it may be a little cheaty but it works!
Here ya go:
01 | local Spin_Part = script.Parent |
02 | local Spin_Pos = Spin_Part.Position |
05 | local function Rotate(State,Hit_Model) |
06 | while Hit_Model.Humanoid.Jump = = false do |
08 | Hit_Model:SetPrimaryPartCFrame(Spin_Part.CFrame) |
10 | Hit_Model.PrimaryPart = Hit_Model.HumanoidRootPart |
11 | Hit_Model.RoPart:Destroy() |
16 | Spin_Part.Touched:connect( function (hit) |
17 | if Can = = true and hit.Parent:IsA( "Model" ) and hit.Parent:FindFirstChild( "HumanoidRootPart" ) and hit.Parent:FindFirstChild( "Humanoid" ) and not hit.Parent:FindFirstChild( "RoPart" ) then |
19 | local RotatePart = Instance.new( "Part" ) |
20 | RotatePart.Name = "RoPart" |
21 | RotatePart.Size = Vector 3. new( 0 , 0 , 0 ) |
22 | RotatePart.Transparency = 1 |
23 | RotatePart.Anchored = true |
24 | RotatePart.CanCollide = false |
25 | RotatePart.Locked = true |
26 | RotatePart.CFrame = Spin_Part.CFrame |
27 | RotatePart.Parent = hit.Parent |
28 | hit.Parent.PrimaryPart = RotatePart |
29 | repeat wait() until hit.Parent.Humanoid.FloorMaterial ~ = nil |
30 | Rotate( true ,hit.Parent) |
36 | Spin_Part.CFrame = Spin_Part.CFrame*CFrame.fromEulerAnglesXYZ( 0 , 0.05 , 0 ) |
Just put this script alone into your part, and it'll take care of the rest.
No editing is needed for part positions, It will adapt to the part you put it in!
I'm not sure if it'll work with more then one player, but it will work with anything containing a part named "HumanoidRootPart" and a Humanoid! (inside a Model)
So you can rotate custom made boxes and stuff.
Enjoy!
remember to mark this as the solution if it works