Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Newexotik/Priority3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

deprecated in favor of priority 5

https://github.com/HighFlowey/Priority

Priority3 [statemachine]

Priority based state machine for Roblox


you can use this module to easily add priority based states to your humanoids or other types of instances and have full control over them

Get


Roblox marketplace:

https://www.roblox.com/library/14087292942/Priority3

Github:

https://github.com/HighFlowey/Priority3/releases/tag/Release


API Document


Properties

  • class.State: string --> current active state

  • class.Priorities.StateName: state (read-only) replaced with class.States.StateName but it still works

  • class.States.StateName: state (read-only)

  • state.Properties: table → example: {WalkSpeed = 16}

  • state.PrevEnabled: boolean (read-only) --> changes to state.Enabled after class:ListenToChange is fired

  • state.PrevActive: boolean (read-only) --> changes to state.Active after class:ListenToChange is fired

  • state.Enabled: boolean (read-only)

  • state.Active: boolean (read-only)

  • state.Checks: table --> contains functions that give permission for activating the state

Functions

  • module.GetClass( object: Instance ): class

  • module.CreateStateConfig(info: {} | nil): Stateconfig

Methods

  • class:SetEnabled( state_name: string, enabled: boolean ): boolean --> enables/disables the state and returns its active property

  • class:AddState(config: Stateconfig): void

  • class:RemoveState(state_name: string): void

  • class:Update(): void --> use this after manually changing properties of a state

  • class:AddCheck(state_name: string, checkId: string|any, checkFunction: function) --> add a check function for a state to let the module know if its allowed to activate it or not (return true to allow return nothing to not allow) also it checks run checks after every frame

  • class:CanActivate(state_name: string): boolean --> returns true if a state can have the highest priority among other enable states

Events

  • class:ListenToChange( state_name: string ):Connect(enabled: boolean, active: boolean): RBXScriptConnection

About

Priority based state machine for Roblox

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages