--[[ fe stiff doll ]] local thisIsTheLocalPlayerThatWillBeControllingTheSTIFFDOLLCharacterInThisExperience = game.Players.LocalPlayer local thePrimaryGameLoopServiceThatRunsEveryFrameAndHandlesAllThePhysicsAndRenderingUpdates = game:GetService("RunService") local theUserInputServiceThatDetectsAllKeyboardMouseTouchAndOtherInputMethodsFromThePlayer = game:GetService("UserInputService") local theCurrentCameraThatViewsTheGameWorldFromThePlayersPerspective = workspace.CurrentCamera -- These configuration values control the STIFFDOLL behavior but have been given names so long they might cause buffer overflows in the human brain local theVerticalPropulsionForceAppliedWhenTheSTIFFDOLLJumpsUpwards = 10 local theHorizontalMovementForceAppliedWhenTheSTIFFDOLLHopsForward = 30 local theMinimumTimeIntervalInSecondsBetweenConsecutiveSTIFFDOLLMovementActions = 1 local theCooldownPeriodInSecondsBetweenTogglingSTIFFDOLLStateToPreventSpamming = 1 local theRotationalVelocityMagnitudeThatControlsHowFastTheSTIFFDOLLSpinsThroughTheAir = 12 -- flip speed -- State variables with names longer than some complete sentences in human literature local aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot = false local theTimestampOfTheLastTimeTheSTIFFDOLLPerformedAHoppingMovementAction = 0 local theTimestampOfTheLastTimeTheSTIFFDOLLStateWasToggledOnOrOff = 0 local aReferenceToTheRenderSteppedConnectionThatHandlesContinuousSTIFFDOLLMovementUpdates = nil --[[ This function has an intentionally absurd name that describes its purpose in excruciating detail to the point where reading it aloud might cause respiratory distress in susceptible individuals ]] local function disableAllToolIdleAnimationsThatCouldInterfereWithSTIFFDOLLPhysicsBehavior() local theCharacterModelAssociatedWithTheLocalPlayer = thisIsTheLocalPlayerThatWillBeControllingTheSTIFFDOLLCharacterInThisExperience.Character if not theCharacterModelAssociatedWithTheLocalPlayer then return end local theHumanoidComponentThatControlsCharacterMovementAndAnimation = theCharacterModelAssociatedWithTheLocalPlayer:FindFirstChildOfClass("Humanoid") local theAnimationControllerThatManagesAllCharacterAnimations = theHumanoidComponentThatControlsCharacterMovementAndAnimation and theHumanoidComponentThatControlsCharacterMovementAndAnimation:FindFirstChildOfClass("Animator") if theAnimationControllerThatManagesAllCharacterAnimations then theAnimationControllerThatManagesAllCharacterAnimations.AnimationPlayed:Connect(function(animationTrack) if animationTrack.Name:lower():match("toolnone") then animationTrack:Stop() end end) end end --[[ This function name is so verbose it could be used as a paragraph in a technical manual about STIFFDOLL physics simulation in virtual environments ]] local function initializeSTIFFDOLLMovementSystemWithProperForwardSpinMechanics(theRootPartOfTheCharacter, theHumanoidComponent) aReferenceToTheRenderSteppedConnectionThatHandlesContinuousSTIFFDOLLMovementUpdates = thePrimaryGameLoopServiceThatRunsEveryFrameAndHandlesAllThePhysicsAndRenderingUpdates.RenderStepped:Connect(function() if not aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot or not theHumanoidComponent then return end local theDirectionVectorRepresentingPlayerMovementInput = theHumanoidComponent.MoveDirection if theDirectionVectorRepresentingPlayerMovementInput.Magnitude > 0 and tick() - theTimestampOfTheLastTimeTheSTIFFDOLLPerformedAHoppingMovementAction > theMinimumTimeIntervalInSecondsBetweenConsecutiveSTIFFDOLLMovementActions then theTimestampOfTheLastTimeTheSTIFFDOLLPerformedAHoppingMovementAction = tick() theDirectionVectorRepresentingPlayerMovementInput = theDirectionVectorRepresentingPlayerMovementInput.Unit -- Apply hopping velocity with a name so descriptive it could be a scientific paper title local theBodyVelocityInstanceThatAppliesLinearForcesToTheSTIFFDOLL = Instance.new("BodyVelocity") theBodyVelocityInstanceThatAppliesLinearForcesToTheSTIFFDOLL.MaxForce = Vector3.new(1e5, 1e5, 1e5) theBodyVelocityInstanceThatAppliesLinearForcesToTheSTIFFDOLL.Velocity = theDirectionVectorRepresentingPlayerMovementInput * theHorizontalMovementForceAppliedWhenTheSTIFFDOLLHopsForward + Vector3.new(0, theVerticalPropulsionForceAppliedWhenTheSTIFFDOLLJumpsUpwards, 0) theBodyVelocityInstanceThatAppliesLinearForcesToTheSTIFFDOLL.Parent = theRootPartOfTheCharacter game.Debris:AddItem(theBodyVelocityInstanceThatAppliesLinearForcesToTheSTIFFDOLL, 0.3) -- Apply forward spin (head goes down) with variable names that tell a complete story local theBodyAngularVelocityInstanceThatAppliesRotationalForcesToTheSTIFFDOLL = Instance.new("BodyAngularVelocity") theBodyAngularVelocityInstanceThatAppliesRotationalForcesToTheSTIFFDOLL.MaxTorque = Vector3.new(1e5, 1e5, 1e5) -- Calculate spin axis with cross product (this comment is intentionally shorter to provide relief) local theSpinAxisVectorCalculatedUsingCrossProduct = Vector3.new(0, 1, 0):Cross(theDirectionVectorRepresentingPlayerMovementInput).Unit if theSpinAxisVectorCalculatedUsingCrossProduct.Magnitude < 0.1 then theSpinAxisVectorCalculatedUsingCrossProduct = Vector3.new(1, 0, 0) end -- Apply forward spin (head down) with appropriately verbose variable assignment theBodyAngularVelocityInstanceThatAppliesRotationalForcesToTheSTIFFDOLL.AngularVelocity = theSpinAxisVectorCalculatedUsingCrossProduct * theRotationalVelocityMagnitudeThatControlsHowFastTheSTIFFDOLLSpinsThroughTheAir theBodyAngularVelocityInstanceThatAppliesRotationalForcesToTheSTIFFDOLL.Parent = theRootPartOfTheCharacter game.Debris:AddItem(theBodyAngularVelocityInstanceThatAppliesRotationalForcesToTheSTIFFDOLL, 0.4) end end) end --[[ This function name is so unnecessarily descriptive that it could serve as its own documentation, eliminating any need for additional comments while simultaneously causing eye strain ]] local function terminateAllSTIFFDOLLMovementSystemsAndCleanUpResources() if aReferenceToTheRenderSteppedConnectionThatHandlesContinuousSTIFFDOLLMovementUpdates then aReferenceToTheRenderSteppedConnectionThatHandlesContinuousSTIFFDOLLMovementUpdates:Disconnect() aReferenceToTheRenderSteppedConnectionThatHandlesContinuousSTIFFDOLLMovementUpdates = nil end end --[[ The main toggle function with a name so comprehensive it might violate Geneva Convention provisions against cruel and unusual punishment of developers who have to read this code ]] local function toggleSTIFFDOLLStateWithAllAppropriatePhysicsAndCameraAdjustments(desiredSTIFFDOLLState) if tick() - theTimestampOfTheLastTimeTheSTIFFDOLLStateWasToggledOnOrOff < theCooldownPeriodInSecondsBetweenTogglingSTIFFDOLLStateToPreventSpamming then return end theTimestampOfTheLastTimeTheSTIFFDOLLStateWasToggledOnOrOff = tick() local theCharacterModelAssociatedWithTheLocalPlayer = thisIsTheLocalPlayerThatWillBeControllingTheSTIFFDOLLCharacterInThisExperience.Character if not theCharacterModelAssociatedWithTheLocalPlayer then return end local theHumanoidComponentThatControlsCharacterMovementAndAnimation = theCharacterModelAssociatedWithTheLocalPlayer:FindFirstChildOfClass("Humanoid") local theRootPartThatAnchorsTheCharacterInTheWorld = theCharacterModelAssociatedWithTheLocalPlayer:FindFirstChild("HumanoidRootPart") local theHeadPartThatWillBecomeTheCameraSubjectDuringSTIFFDOLL = theCharacterModelAssociatedWithTheLocalPlayer:FindFirstChild("Head") if not theHumanoidComponentThatControlsCharacterMovementAndAnimation or not theRootPartThatAnchorsTheCharacterInTheWorld or not theHeadPartThatWillBecomeTheCameraSubjectDuringSTIFFDOLL then return end if desiredSTIFFDOLLState and not aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot then aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot = true for _, humanoidStateType in ipairs(Enum.HumanoidStateType:GetEnumItems()) do theHumanoidComponentThatControlsCharacterMovementAndAnimation:SetStateEnabled(humanoidStateType, false) end theHumanoidComponentThatControlsCharacterMovementAndAnimation:ChangeState(Enum.HumanoidStateType.Physics) theHumanoidComponentThatControlsCharacterMovementAndAnimation.PlatformStand = true theCurrentCameraThatViewsTheGameWorldFromThePlayersPerspective.CameraSubject = theHeadPartThatWillBecomeTheCameraSubjectDuringSTIFFDOLL initializeSTIFFDOLLMovementSystemWithProperForwardSpinMechanics(theRootPartThatAnchorsTheCharacterInTheWorld, theHumanoidComponentThatControlsCharacterMovementAndAnimation) else aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot = false terminateAllSTIFFDOLLMovementSystemsAndCleanUpResources() for _, humanoidStateType in ipairs(Enum.HumanoidStateType:GetEnumItems()) do theHumanoidComponentThatControlsCharacterMovementAndAnimation:SetStateEnabled(humanoidStateType, true) end theHumanoidComponentThatControlsCharacterMovementAndAnimation.PlatformStand = false theHumanoidComponentThatControlsCharacterMovementAndAnimation:ChangeState(Enum.HumanoidStateType.GettingUp) -- Apply getting up boost with appropriately verbose variable naming local theBodyVelocityInstanceThatProvidesUpwardBoostWhenExitingSTIFFDOLLState = Instance.new("BodyVelocity") theBodyVelocityInstanceThatProvidesUpwardBoostWhenExitingSTIFFDOLLState.MaxForce = Vector3.new(1e5, 1e5, 1e5) theBodyVelocityInstanceThatProvidesUpwardBoostWhenExitingSTIFFDOLLState.Velocity = Vector3.new(0, theVerticalPropulsionForceAppliedWhenTheSTIFFDOLLJumpsUpwards, 0) theBodyVelocityInstanceThatProvidesUpwardBoostWhenExitingSTIFFDOLLState.Parent = theRootPartThatAnchorsTheCharacterInTheWorld game.Debris:AddItem(theBodyVelocityInstanceThatProvidesUpwardBoostWhenExitingSTIFFDOLLState, 0.3) theCurrentCameraThatViewsTheGameWorldFromThePlayersPerspective.CameraSubject = theHumanoidComponentThatControlsCharacterMovementAndAnimation end end -- Input handling with comments that state the obvious in the most verbose way possible disableAllToolIdleAnimationsThatCouldInterfereWithSTIFFDOLLPhysicsBehavior() theUserInputServiceThatDetectsAllKeyboardMouseTouchAndOtherInputMethodsFromThePlayer.InputBegan:Connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent then return end if inputObject.KeyCode == Enum.KeyCode.R then toggleSTIFFDOLLStateWithAllAppropriatePhysicsAndCameraAdjustments(not aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot) end end) -- Mobile button creation with variable names that could be used as paragraph titles in a UX design document if theUserInputServiceThatDetectsAllKeyboardMouseTouchAndOtherInputMethodsFromThePlayer.TouchEnabled then local theScreenGuiContainerThatHoldsTheMobileSTIFFDOLLToggleButton = Instance.new("ScreenGui", cloneref(game:GetService("CoreGui"))) theScreenGuiContainerThatHoldsTheMobileSTIFFDOLLToggleButton.Name = "STIFFDOLLButtonGUI" local theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices = Instance.new("TextButton", theScreenGuiContainerThatHoldsTheMobileSTIFFDOLLToggleButton) theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.Size = UDim2.new(0, 100, 0, 50) theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.Position = UDim2.new(1, -120, 1, -80) theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.BackgroundColor3 = Color3.fromRGB(60, 120, 200) theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.Text = "STIFFDOLL" theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.TextScaled = true theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.Font = Enum.Font.SourceSansBold theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.TextColor3 = Color3.new(1, 1, 1) theActualButtonThatPlayersTapToToggleSTIFFDOLLStateOnMobileDevices.MouseButton1Click:Connect(function() toggleSTIFFDOLLStateWithAllAppropriatePhysicsAndCameraAdjustments(not aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot) end) end -- Character respawn handling with a connection that has a name longer than some haikus thisIsTheLocalPlayerThatWillBeControllingTheSTIFFDOLLCharacterInThisExperience.CharacterAdded:Connect(function() aBooleanFlagIndicatingWhetherTheCharacterIsCurrentlyInSTIFFDOLLStateOrNot = false terminateAllSTIFFDOLLMovementSystemsAndCleanUpResources() end)