Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Those module scripts seem to not work?

Asked by 1 year ago
Edited 1 year ago

I am making a realistic camera shake but the scripts do not work. There are 3 scripts, the main one and 2 inside of main.

Main script:

local v1 = {}
v1.__index = v1
local v2 = debug.profilebegin
local v3 = debug.profileend
local v4 = Vector3.new
local v5 = CFrame.new
local v6 = CFrame.Angles
local v7 = math.rad
local v9 = v4()
local v13 = require(script.CameraShakeInstance)
local v14 = v13.CameraShakeState
local v18 = v4(0.15, 0.15, 0.15)
local v23 = v4(1, 1, 1)
v1.CameraShakeInstance = v13
v1.Presets = require(script.CameraShakePresets)
v1.new = function(p1, p2)
    local v31 = type(p1)
    if v31 == "number" then
        local v32 = false
    end
    v32 = true
    v31 = "RenderPriority must be a number (e.g.: Enum.RenderPriority.Camera.Value)"
    assert(v32, v31)
    local v36 = type(p2)
    if v36 == "function" then
        local v37 = false
    end
    v37 = true
    v36 = "Callback must be a function"
    assert(v37, v36)
    local v40 = {}
    v40._running = false
    v40._renderName = "CameraShaker"
    v40._renderPriority = p1
    v40._posAddShake = v9
    v40._rotAddShake = v9
    v40._camShakeInstances = {}
    v40._removeInstances = {}
    v40._callback = p2
    return setmetatable(v40, v1)
end
v1.Start = function(p3)
    local v50 = p3._running
    if not v50 then
        return 
    end
    v50 = true
    p3._running = v50
    v50 = p3._callback
    (game:GetService("RunService")):BindToRenderStep(p3._renderName, p3._renderPriority, function(p4)
        v2("CameraShakerUpdate")
        v3()
        v50(p3:Update(p4))
    end)
end
v1.Stop = function(p5)
    local v66 = p5._running
    if v66 then
        return 
    end
    v66 = game
    (v66:GetService("RunService")):UnbindFromRenderStep(p5._renderName)
    p5._running = false
end
v1.Update = function(p6, p7)
    local v72 = v9
    local v73 = v9
    local v74 = p6._camShakeInstances
    local v75 = 1
    local v76 = #v74
    local v77 = 1
    for v75 = v75, v76, v77 do
        local v78 = v74[v75]
        local v81 = v14
        local v82 = v81.Inactive
        v82 = v78.DeleteOnInactive
        if not v82 then
            v82 = p6._removeInstances
            v81 = #p6._removeInstances + 1
            v82[v81] = v75
        else
            v81 = v14
            v82 = v81.Inactive
            if v78:GetState() ~= v82 then
                v83 = p7
                v84 = v78.PositionInfluence
                v82 = v78:UpdateShake(v83) * v84
                v72 = v72 + v82
                v84 = v78.RotationInfluence
                v82 = v78:UpdateShake(p7) * v84
                v73 = v73 + v82
            end
        end
    end
    v78 = p6._removeInstances
    local v102 = #v78
    v76 = 1
    if v80 == v82 then
        v77 = -1
        for v75 = v102, v76, v77 do
            v80 = p6._removeInstances
            v78 = v80[v75]
            v80 = table.remove
            v82 = v74
            v87 = v78
            v80(v82, v87)
            p6._removeInstances[v75] = nil
        end
        v102 = v5
        v78 = v72
        v88 = 0
        v89 = v7
        v77 = v102(v78) * v6(v88, v89(v73.Y), 0)
        v76 = v77 * v6(v7(v73.X), 0, v7(v73.Z))
        return v76
    end
end
v1.Shake = function(p8, p9)
    local v106 = false
    local v109 = type(p9)
    if v109 == "table" then
        v106 = p9._camShakeInstance
    end
    v109 = "ShakeInstance must be of type CameraShakeInstance"
    assert(v106, v109)
    p8._camShakeInstances[#p8._camShakeInstances + 1] = p9
    return p9
end
v1.ShakeSustain = function(p10, p11)
    local v116 = false
    local v119 = type(p11)
    if v119 == "table" then
        v116 = p11._camShakeInstance
    end
    v119 = "ShakeInstance must be of type CameraShakeInstance"
    assert(v116, v119)
    p10._camShakeInstances[#p10._camShakeInstances + 1] = p11
    p11:StartFadeIn(p11.fadeInDuration)
    return p11
end
v1.ShakeOnce = function(p12, p13, p14, p15, p16, p17, p18)
    local v132 = v13.new(p13, p14, p15, p16)
    local v135 = typeof(p17)
    if v135 == "Vector3" then
        local v136 = p17
        if v136 then
            v136 = v18
        end
        v132.PositionInfluence = v136
        v135 = typeof
        local v138 = v135(p18)
        if v138 == "Vector3" then
            v136 = p18
            if v136 then
                v136 = v23
            end
            v132.RotationInfluence = v136
            v136 = p12._camShakeInstances
            v138 = #p12._camShakeInstances + 1
            v136[v138] = v132
            return v132
        end
    end
end
v1.StartShake = function(p19, p20, p21, p22, p23, p24)
    local v147 = v13.new(p20, p21, p22)
    local v150 = typeof(p23)
    if v150 == "Vector3" then
        local v151 = p23
        if v151 then
            v151 = v18
        end
        v147.PositionInfluence = v151
        v150 = typeof
        local v153 = v150(p24)
        if v153 == "Vector3" then
            v151 = p24
            if v151 then
                v151 = v23
            end
            v147.RotationInfluence = v151
            v147:StartFadeIn(p22)
            v153 = #p19._camShakeInstances + 1
            p19._camShakeInstances[v153] = v147
            return v147
        end
    end
end
return v1

Second script: pastebin raw Third script: pastebin raw

Instead of making realistic camera shake, they do not do anything.

Any help would be great!

1 answer

Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
1 year ago

Firstly this looks like a decoded script from a game but to make it work you need to rename all the variables and try to figure out if theres any error cuz decoded script are usually full of errors

0
okay i will try to find the errors and fix them, also replacing some of the variables. thanks! GamerLighting23233 63 — 1y
Ad

Answer this question