Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using { /Verse.org/Native }
- using { /Verse.org/SceneGraph }
- using { /Verse.org/Simulation }
- using { /Verse.org/SpatialMath }
- using { /Verse.org/SceneGraph/KeyframedMovement }
- using { /Fortnite.com/Devices }
- BuildDoorPrompt<localizes>(Action:string, DoorType:string):message = "{Action} {DoorType}"
- DefaultOpenPrompt<localizes>:message = "Open Door"
- DefaultClosePrompt<localizes>:message = "Close Door"
- door_component := class<final_super>(interactable_component):
- @editable
- DoorType : string = "Door" #Example Options: "Door", "Cabinet", "Cupboard", "Dresser"
- #The amount you want to rotate the door in degrees.
- @editable
- RotationAmount : float = 90.0
- #The speed at which the door opens and closes, in seconds.
- @editable
- OpenCloseSpeed : float = 0.5
- #Reverses the side of the door when true.
- @editable
- DoorSide : logic = false
- #The default state of the door when the game starts.
- @editable
- var IsOpen : logic = false
- #Prevents the door from being interacted with while it's opening or closing.
- var IsAnimating : logic = false
- #Optional sound component reference for playing sounds when the door is interacted with.
- var DoorSoundComponent : ?sound_component = false
- #Promps for interacting with the door, which can be customized based on the door type.
- var OpenPrompt : message = DefaultOpenPrompt
- var ClosePrompt : message = DefaultClosePrompt
- OnBeginSimulation<override>():void =
- (super:)OnBeginSimulation()
- #Creates the interaction prompts
- set OpenPrompt = BuildDoorPrompt("Open", DoorType)
- set ClosePrompt = BuildDoorPrompt("Close", DoorType)
- #sets the sound component if it exists on the entity
- if (SoundComp := Entity.GetComponent[sound_component]):
- set DoorSoundComponent = option{SoundComp}
- #When the door is interacted with, it will call the OnDoorInteracted function.
- SucceededEvent.Subscribe(OnDoorInteracted)
- #When the door is interacted with, this function is called.
- OnDoorInteracted(Agent:agent):void =
- Print("Door interacted")
- if (not IsAnimating?):
- spawn{PlayAnimation()}
- #Handles the door opening and closing animation, as well as playing sounds if a sound component is attached.
- PlayAnimation()<suspends>:void =
- if(IsAnimating = false):
- set IsAnimating = true
- OpenYaw : float =
- if (DoorSide = true):
- -RotationAmount
- else:
- RotationAmount
- var ActualDeltaYaw : float = OpenYaw
- if (IsOpen?):
- set ActualDeltaYaw = -OpenYaw
- set IsOpen = false
- else:
- set IsOpen = true
- if (KeyframeComponent := Entity.GetComponent[keyframed_movement_component]):
- Keyframe := keyframed_movement_delta{
- Transform := transform{
- Rotation := MakeRotationFromYawPitchRollDegrees(ActualDeltaYaw, 0.0, 0.0)
- Translation := vector3{Left := 0.0, Up := 0.0, Forward := 0.0}
- Scale := vector3{Left := 0.0, Up := 0.0, Forward := 0.0}
- }
- Duration := OpenCloseSpeed
- Easing := ease_in_out_cubic_bezier_easing_function{}
- }
- AllKeyframes : []keyframed_movement_delta = array{Keyframe}
- KeyframeComponent.SetKeyframes(AllKeyframes, oneshot_keyframed_movement_playback_mode{})
- KeyframeComponent.Play()
- if (SoundComp := DoorSoundComponent?):
- SoundComp.Play()
- KeyframeComponent.FinishedEvent.Await()
- set IsAnimating = false
- #Determines which prompt to show when the player interacts with the door, based on whether the door is currently open or closed.
- InteractMessage<override>(Agent:agent)<decides><reads>:message =
- if (IsOpen?):
- ClosePrompt
- else:
- OpenPrompt
- #Additionally, you can call these functions to explicitly open or close the door from other parts of your code, such as triggers or other interactions.
- OpenDoor(Agent:agent):void=
- if(IsOpen = false):
- spawn{PlayAnimation()}
- CloseDoor():void=
- if(IsOpen = true):
- spawn{PlayAnimation()}
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=fvhqpfwrxr
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment