Stun Module v0.1

[Module Stun v0.1]

Introduction

Welcome to the Module Stun developer guide! This module helps you manage stun effects in your Roblox game with features like temporary humanoid property modifications, customizable behaviors, and debugging tools. Perfect for combat systems or ability cooldowns, Module Stun is lightweight and easy to integrate.

Get the Module: Stun v0.1 ( click here )


Key Features

  • Dynamic Stun Effects: Temporarily modifies properties like WalkSpeed and JumpPower.
  • Customizable Callbacks: Run custom code when stun starts or ends.
  • Stacking Control: Choose whether stun durations stack or override.
  • Debugging Tools: Built-in debugging for easier development.
  • Flexible Targeting: Supports advanced object-finding mechanisms.

Getting Started

Installation

  1. Place the module script in your Roblox project.
  2. Require the module in your script:
    local Stun = require(path.to.ModuleStun)
    
    local humanoid = player.Character:FindFirstChild("Humanoid")
    if humanoid then
       humanoid:GetAttributeChangedSignal("Stun"):Connect(function()
          print( "Stunned !!!!" )
       end)
       
       Stun._Stun(humanoid, 5) -- Apply a stun effect for 5 seconds
    end
    
    

Configuration

The module comes with a Config table to customize its behavior.

Property Description Default
StunLabel The attribute name used for stun tracking. "Stun"
Pattern Prefix for debug messages. "[ Stun Handle ]"
CanStack Allow durations to stack. true
EnableEdit Enable custom callback functions. true
Effects Properties affected during stun. { Walkspeed = true, JumpPower = true }
Ignore List of instance names to ignore for stuns. { "Immortal" }
Debug Enable debug messages. true

FAQ & Troubleshooting

  • Why isn’t the stun working?
    • Ensure the Humanoid is valid and not in the Ignore list.
  • Can I modify other properties?
    • Yes! Add new entries to the Config.Effects table.
  • How do I enable debugging?
    • Set Config.Debug = true to see detailed logs.

Feedback & Contributions

Feel free to share feedback, report bugs, or suggest improvements. Let’s collaborate to make Module Stun even better! :blush:

2 Likes

This is pretty good! A lot better than all other stun modules I’ve seen. Thank you haha!

1 Like

This looks nice!

Are you able to provide a testing place that is editable or .rbxl with some examples like blocks u hit that show the effects ?

Also could this be modified to increase speed? For like speed boost effects and such?

Thanks

1 Like

Hi,

It is not letting the player walk after 5 seconds… they are stuck in stun… they can jump, but not walk…

I made a simple test when the player touches a part, it calls the stun module, and also destroys the part.

It calls the stun model, and stuns then but they are stuck not being able to move. Its should only be for 5 seconds.

I turned debug on, there are no errors.

I also want it to be scripts, not localscripts.

Here is the Output:


  14:15:34.922  [ Stun Handle ]  Set Enable Running.  -  Server - Stun:110
  14:15:34.922  something run when stun  -  Server - Stun:33

Here is the script

local part = script.Parent
local Players = game:GetService("Players")
local StunModule = require(game:GetService("ServerScriptService").Stun)

part.Touched:Connect(function(hit)
    local player = Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        local humanoid = player.Character:FindFirstChild("Humanoid")
        if humanoid then
            StunModule._Stun(humanoid, 5) -- Stun the player for 5 seconds
        end
    end
end)

here is the Explorer:

Here is the blocks, I made a few of them…

Here is the .rbxl for easy debugging:
stun on part touch.rbxl (59.8 KB)

Thanks if you can figure out why they cannot move.

2 Likes

Right now, I don’t have much time to develop modules. I have a lot of work to do right now.