Framework Functions
Functions in ClassesFramework
Short description
This page lists out functions in the Framework.
Setting up the framework
Calling the framework
Initial character stats, conditions
Framework.StartHitboxes()
This function is not used commonly in classes It is used within the framework scripts but is not called directly ouside of that.
This function continuously loops to check for hits.
Framework.UpdateCondition()
Changing a condition in the player's Condition folder and a value to go along with it
Framework.ToggleSuperArmor()
Framework.UpdateColors()
Used within SkinHandler only Additionally, some of the color usage may seem a bit weird
Updates Framework.Character.Colors (character display colours) from a set of colours. A Color3Value is created for each color listed.
Framework.UpdateStats()
Updates a player's stats.
Cooldown Functions
Framework.FakeCooldown()
The FakeCooldown function is there for visual representation, aka for the HUD.
Framework.Cooldown()
This is the actual cooldown function for a move.
Framework.OnCooldown()
Checks if a move is currently on cooldown.
Framework.IsKeyHeld()
Checks if a key is being held.
FPS and yield functions
Some things to note
FPS fluctuates, in this case things like animation speed are affected.
The yield/wait functions are used for timing events and intervals throughout the framework.
If the yield waits were not adjusted for FPS, they could end up waiting too long or too short depending on the current framerate.
Framework.DefaultFPS()
sets a baseline expected FPS, like 60.Framework.GetFPS()
gets the actual current FPS of the characterFramework.GetFPSFactor()
calculates the ratio of actual to defaultFor example, at 30 FPS the factor would be 0.5 (30/60)
When yielding, if
AffectedByFPS
istrue
, it will divide the wait time by this factor At 30 FPS, a 1 second wait would adjust to 2 seconds (1/0.5)
Framework.GetFPS()
Not used within classes You are likely looking for GetFPSFactor().
Get FPS of character.
Framework.GetFPSFactor()
Factor to adjust for FPS. If the FPS was 30 but the default FPS was 60, the factor returned would be 0.5 (30/60 = 0.5).
Framework.Yield()
Wait function that converts time to yield to frames.
Framework.YieldFrames()
Input: YieldFrames(10, false) Output: Waiting for 10 frames, return 0.167s at 60FPS
Input: YieldFrames(10, false) FPS Factor = 0.5 (given that the FPS is 30) Output: Frames adjusted to 20 (10/0.5 = 20). Wait 20 frames, return 0.333s at 30FPS
Tables & Some Angles
Framework.GetTableAmount()
Framework utility function This function is not really used outside of the framework script itself.
Count number of elements in a table.
Framework.RandomFromTable()
Framework utility function This function is not really used outside of the framework script itself.
Pick random element from a table.
Framework.RandomAngle()
Framework utility function This function is not really used outside of the framework script itself.
Pick a random angle.
Framework.CreateRegion3FromLocAndSize()
Framework utility function This function is not really used outside of the framework script itself.
Create Region3 from center position and size.
Framework.CopyArray()
Framework utility function This function is not really used outside of the framework script itself.
Deep copy a table.
Humanoid conditions checker
Framework.ToggleHumanoidCollision()
Toggle collision groups for character parts.
Framework.GetHumanoidFromPart()
Framework utility function This function is not really used outside of the framework script itself.
Get humanoid from part's parent model.
Framework.IsInTeam()
Check if target is in same team.
Framework.CheckGrab()
Check if a target can be grabbed. Used for grabs like Assailant SP6.
Combat Functions - Damaging
Framework.Parry()
Play parry effects and stun attacker.
Framework.Stun()
Apply stun state.
Framework.ScaleDamage()
Scale combo damage falloff. Very rarely used within classes themselves.
Framework.CheckComboTimeLimit()
Non-standard function Combo time limits do not exist in the actual BM2. This is a new addition that is yet to be fully implemented within the place.
Function to check combo time.
Framework.ApplyDamage()
Apply damage and effects.
Framework.NApplyDamage()
Non-standard function Only used by old Kar98k tool (Viethin modification). Do not use the NApplyDamage function in actual classes.
Combat Functions - Finished Combos
Framework.ComboEnded()
Framework.CleanMovers()
Framework.ClientControlVel()
Combat Functions - Knockback
Framework.Knockback()
Framework.MoveTo()
Framework.PushCharacter()
Framework.Root()
Combat Functions - Hitboxes
Some things to note
Framework.GetHumanoidFromPart(part) [This somewhat still counts]
This takes a BasePart and tries to find a Model parent with a Humanoid and Conditions child.
Checks if the model Health > 0 and Iframes = false Returns the model if found, nil otherwise.
Hitbox.Detect(scale, customCFrame) [in Framework.CreateHitbox]
Casts a RotatedRegion3 from the hitbox Part's CFrame and scale.
Loops through results and calls GetHumanoidFromPart on each part.
Stores any found humanoids in a table and returns it.
Hitbox.Part.Touched Event [in Framework.CreateHitbox]
Connects to the Touched event on the hitbox Part.
Gets the touched part's Model parent.
Calls OnTouch and passes the model if found via GetHumanoidFromPart.
Hitbox.Fire() [in Framework.CreateHitbox]
Calls Detect() to get humanoids in the current hitbox bounds.
Loops through and calls OnTouch on each one.
Hitbox.Remote Event [in Framework.CreateHitbox]
RemoteEvent created on the server.
OnServerEvent connects to call OnTouch on synced model.
Framework.CreateHitbox()
Combat Functions - Raycasts
Linear interpolation
With the BM2 framework this is used to smoothly transition between two values over time.
It calculates an "interpolated" value based on a factor t between 0-1.
When t=0 it returns the first value. When t=1 it returns the second value.
For values in between, it calculates a weighted average of the two values based on t.
For example, to linearly interpolate between value a and b:
When t=0, return a
When t=1, return b
For t between 0-1,
return a * (1-t) + b * t (search it up if unsure)
This gives a straight linear transition between the two values.
Bezier curve
A Bezier curve is defined by n+1 "control points", imagine: P0, P1, ..., Pn.
For a quadratic we have 3 points (n=2), cubic uses 4 points (n=3).
It uses polynomial equations to calculate curve points. This allows for smooth curved paths compared to linear interpolation
Quadratic Beziers:
The curve is calculated as: B(t) = (1-t)2P0 + 2(1-t)tP1 + t2P2.
Where t varies from 0 to 1,
B(0) = P0, B(1) = P2
B(t) gives the point on the curve for that value of t
Cubic Beziers:
Now we have segments...
Let's make 2 of these segments, these are calculated as
B1(t) = (1-t)3P0 + 3(1-t)2tP1 + 3(1-t)t2P2 + t3P3
B2(t) = (1-t)3P1 + 3(1-t)2tP2 + 3(1-t)t2P3 + t3P4
B1 calculates points between P0-P1, B2 between P1-P2
The overall curve is: B(t) = B1(t)(1-t) + B2(t)t
Framework.RelativeCF()
Framework.NumberLerp()
Framework.Lerp()
Framework.QuadBezier()
Framework.CubicBezier()
Framework.RayCast()
Framework.RayCastWhiteList()
Combat Functions - Moves
Framework.UpdateWalkSpeed()
Framework.D_Moves()
Combat Functions - Core Class Functions
Framework.DoMove()
Framework.CastAction()
Framework.RunEvents()
Last updated
Was this helpful?