I made multiple modules to help you with your battlegrounds game
Modules.rbxm (4.4 KB)
Ragdoll Module (server):
.Start(Rig : Model) -- Returns nil
.Stop(Rig : Model) -- Returns nil
RagdollModule[Rig] -- Check if they are ragdolled (returns a table)
Stun Module (client or server):
.Start(Rig : Model) -- Returns nil
.Stop(Rig : Model) -- Returns nil
StunModule[Rig] -- Check if they are stunned (returns a boolean)
Cooldown Module (client or server):
.new() -- Returns customizable settings
:set(count : number?) -- Returns nil
:update() -- Returns the amount of seconds until the next cooldown (or end of cooldown if there is just one)
The settings documentation found in the source code:
local self = {
lastTick = tick(), -- Seconds since last Count
Count = 0, -- Amount of times the cooldown has repeated for
Settings = {
Infinite = true, -- Goes back to 1 if Count is reset
Repeat = 4, -- How much times the cooldown repeats before stopping or cooldown
Cooldowns = {
resetAfter = 1.5, -- Resets after nth seconds being inactive
resetCooldown = 2, -- The cooldown between the transition from Repeat to 1
Interval = 0.4 -- Cooldown between each repeat
}
}
}
Direction Module (client):
:GetMoveVector() -- I know this already exists but its easier than require(game:GetService("Players").LocalPlayer.PlayerScripts:WaitForChild("PlayerModule").ControlModule):GetMoveVector() (Returns a Vector3)
:IsMoving() -- Ok I know you can just do Humanoid.MoveDirection.Magnitude <= 0 but same reason as last time (Returns a Vector3)
:GetMoveDirections() -- Returns a table with Vector3s
:GetCameraRelativeDirection() -- Returns a Vector3
(I am planning to add a Crater module soon)