#it prints the first lines but never prints when sbf fires (remoteevent runs on other scripts)

1 messages · Page 1 of 1 (latest)

hybrid elm
#

-- LOOKAT MANAGER --

local values = {
    ObjectLookingAt = script.Parent.LookingAt,
    LookAtObject = script.Parent.LookingAtObject
}
print("Manager loaded")
print(game.ReplicatedStorage.BossfightThings.startBossEvent)

local m = require(script.Helper)
local fh = require(game.ReplicatedStorage.BossfightThings.fightHandler)

task.wait(2)
m:LocatePlayerHRP()
task.wait(2)

if values.LookAtObject.Value == true then
    while values.LookAtObject.Value == true do
        task.wait(0.05)
        m:turnEyetoOLA()
    end
end
values.LookAtObject.Changed:Connect(function(v)
    if v == true then
        while values.LookAtObject.Value == true do
            task.wait(0.05)
            m:turnEyetoOLA()
        end
        else end
    
end)

 -- END --
 
 
 -- MOVEMENT MANAGER --
 
local bosspoints = {
    workspace.Points.BossPoint1,
    workspace.Points.BossPoint2,
    workspace.Points.BossPoint3,
    workspace.Points.BossPoint4,
    workspace.Points.BossPoint5

}

local r = game.ReplicatedStorage.BossfightThings.MoveBoss

 r.Event:Connect(function(BossPoint)
        print("RUNNING FRIDGE")
    fh:MoveBossToPoint(BossPoint)    
 end)
 function StartMoving()
        print("startmoving")
        while task.wait(5) do
        local randomIndex = math.random(1, #bosspoints)
        r:Fire(randomIndex)
        end
 end
 
game.ReplicatedStorage.BossfightThings.startBossEvent.OnServerEvent:Connect(function()
print("Boss, i have started the moving")
    StartMoving()
end)