local y={}y.Settings={Enabled=true;JumpIntensity=1.5;DamageIntensity=2.5,FallIntensity=1.5}y.Config={JumpScale=50,DamageScale=25,BaseDamageDuration=.05;DamageDurationScale=50,FallScale=20,BaseFallDuration=.05,FallDurationScale=50;BaseOverallDuration=.1}local K=require(script.Parent.Parent.Modules)function y.Trigger(s,y)s:Stop()if y and y.Settings then if y.Settings.Enabled~=nil then s.Settings.Enabled=y.Settings.Enabled end if y.Settings.JumpIntensity~=nil then s.Settings.JumpIntensity=y.Settings.JumpIntensity end if y.Settings.DamageIntensity~=nil then s.Settings.DamageIntensity=y.Settings.DamageIntensity end if y.Settings.FallIntensity~=nil then s.Settings.FallIntensity=y.Settings.FallIntensity end end if not s.Settings.Enabled then return end local I=y.MasVibrateSettings if not I then return end local V=y.EventName local G=y.Value or 0 local b=0 local R=s.Config.BaseOverallDuration local m=y.MotorChoice or"\098\111\116\104"local r="\067\104\097\114\097\099\116\101\114"if V=="\074\117\109\112"then b=(G/s.Config.JumpScale)*s.Settings.JumpIntensity elseif V=="\068\097\109\097\103\101"then b=(G/s.Config.DamageScale)*s.Settings.DamageIntensity R=s.Config.BaseDamageDuration+G/s.Config.DamageDurationScale elseif V=="\070\097\108\108"then b=(G/s.Config.FallScale)*s.Settings.FallIntensity R=s.Config.BaseFallDuration+G/s.Config.FallDurationScale else b=G>0 and G or s.Settings.JumpIntensity end b=math.clamp(b,I.MinIntensity,I.MaxIntensity)K:Apply(b,R,I,m,r)end function y.Stop(y)K:Stop("\067\104\097\114\097\099\116\101\114")end return y
local PluginCharacter = {}

PluginCharacter.Settings = {
    Enabled = true,
    JumpIntensity = 1.5,
    DamageIntensity = 2.5,
    FallIntensity = 1.5
}

PluginCharacter.Config = {
    JumpScale = 50,
    DamageScale = 25,
    BaseDamageDuration = 0.05,
    DamageDurationScale = 50,
    FallScale = 20,
    BaseFallDuration = 0.05,
    FallDurationScale = 50,
    BaseOverallDuration = 0.1
}

local Modules = require(script.Parent.Parent.Modules)

function PluginCharacter:Trigger(pluginData)
    self:Stop()

    if pluginData and pluginData.Settings then
        if pluginData.Settings.Enabled ~= nil then
            self.Settings.Enabled = pluginData.Settings.Enabled
        end
        if pluginData.Settings.JumpIntensity ~= nil then
            self.Settings.JumpIntensity = pluginData.Settings.JumpIntensity
        end
        if pluginData.Settings.DamageIntensity ~= nil then
            self.Settings.DamageIntensity = pluginData.Settings.DamageIntensity
        end
        if pluginData.Settings.FallIntensity ~= nil then
            self.Settings.FallIntensity = pluginData.Settings.FallIntensity
        end
    end
    if not self.Settings.Enabled then
        return
    end

    local allSettings = pluginData.MasVibrateSettings
    if not allSettings then
        return
    end

    local eventName = pluginData.EventName
    local rawValue = pluginData.Value or 0
    local intensity = 0
    local duration = self.Config.BaseOverallDuration
    local motorChoice = pluginData.MotorChoice or "both"
    local channelName = "Character" 

    if eventName == "Jump" then
        intensity = (rawValue / self.Config.JumpScale) * self.Settings.JumpIntensity
    elseif eventName == "Damage" then
        intensity = (rawValue / self.Config.DamageScale) * self.Settings.DamageIntensity
        duration = self.Config.BaseDamageDuration + (rawValue / self.Config.DamageDurationScale)
    elseif eventName == "Fall" then
        intensity = (rawValue / self.Config.FallScale) * self.Settings.FallIntensity
        duration = self.Config.BaseFallDuration + (rawValue / self.Config.FallDurationScale)
    else
        intensity = rawValue > 0 and rawValue or self.Settings.JumpIntensity
    end

    intensity = math.clamp(intensity, allSettings.MinIntensity, allSettings.MaxIntensity)
    Modules:Apply(intensity, duration, allSettings, motorChoice, channelName)
end

function PluginCharacter:Stop()
    Modules:Stop("Character")
end

return PluginCharacter