🚀Getting Started
📦 Installing
RobloxStateMachine can be installed in different ways, depending on your project's needs. Choose the method that suits you best:
- 🐶 Wally
- 🔨Studio
- 🐙GitHub
Watch wally's page
robloxstatemachine = "prooheckcp/robloxstatemachine@>0.0.0, <10.0.0"
🚀 Basic Usage
Once you have RobloxStateMachine installed, you can start using it in your project. Here's a basic example of how to use it:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RobloxStateMachine = require(ReplicatedStorage.RobloxStateMachine)
local exampleStateMachine = RobloxStateMachine.new(
"InitialState", -- Sets our initial state to "InitialState"
RobloxStateMachine:LoadDirectory(
script.Example.States,
{"Blue", "Default"}), -- "Loads the states called "Blue" and "Default"
{
part = workspace.Example, -- Sends a reference to a part from workspace into the state machine
time = tick(), -- Sends the current tick
dummyData = "Hello World", -- Sends a string
}
)
Looks a bit confusing at the first glance and for that reason we will be showing a very basic example of an implementation.