#problem with module script

1 messages · Page 1 of 1 (latest)

wanton ravine
#

heya so im having a problem with my code (context is that im trying to make it so each hitbox has a new cframe according to a different script but they are all appearing in the same place)

#

script where the module is required

local UserInputService = game:GetService("UserInputService")

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local HitboxModule = require(ReplicatedStorage.Modules:WaitForChild("HitboxModule"))



local character = script.Parent
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
function Hitbox()
    
    local hitboxDuration = 10
    local hitboxPart = HitboxModule.createTemporaryHitbox({
        Size = Vector3.new(5, 5, 5),
        Position = humanoidRootPart.CFrame * CFrame.new(0, 0, -5),
        Duration = hitboxDuration,
        Debounce = hitboxDuration + 0.1,
        NumOfHitboxes = 10,
        
        
        OnHit = function(hitPart, hitEntity, humanoid)
            if humanoid then 
                humanoid.Health -= 10
                print(humanoid.Health)
            end
        end,
        FilterInstances = {character},
        
         
    })
end


while true do    --testing purposes
    Hitbox()
    wait(10)
end
        
next knoll
#

I'm sorry but almost no one will read a 200+ lines script, add print statements in your module to find where the bug is

wanton ravine
#

awh