SetState is applying the state correctly on the player. Returns the table of states of the player in the module.SetState function.
although, module.ReturnStates returns nil
This is how the state is being set on the character right now:
-- SERVER SCRIPT, PARENT IS A PROXIMITY PROMPT INSIDE OF A PART
script.Parent.Triggered:Connect(function()
stateManager.SetState(game.Workspace.Rig, "Parrying", true, 10) -- plr, stateKey, true or false, duration
end)
This is how I'm getting the states
-- MODULE SCRIPT
function module.ReturnStates(plr)
print("Returning State")
print(plr)
return states[plr]
end
print(plr) = returns Rig (game.Workspace.Rig)
SetState prints out the table of all the states set on the player aswell, and it prints them all out correctly
Using the state table for an if statement:
-- THIS IS IN A LOCAL SCRIPT
local states = stateManager.ReturnStates(v.Parent)
print(states)
if table.find(states, "Parrying") then
v.Parent = Rig
** You are now Level 4! **
