#Table bug

1 messages · Page 1 of 1 (latest)

turbid lotus
#

[SERVER]:local ReplicatedStorage = game:GetService("ReplicatedStorage")

local UnitsRequest = ReplicatedStorage.Functions.UnitsRequest

local unitModule = require(ReplicatedStorage.Modules.BossModules.Unit)

local BossesFolder = ReplicatedStorage.Bosses
local map = workspace.Map

local boss = {}

function boss.Start(player,bossName)
print("Boss started")
local bossToClone = BossesFolder:FindFirstChild(bossName)
if bossToClone then
local bossToSpawn = bossToClone:Clone()
bossToSpawn.Parent = map.Mobs
--bossToSpawn.Owner.Value = player.Name
bossToSpawn.HumanoidRootPart.CFrame = map.BossSpawn.CFrame * CFrame.new(0,5,0)
bossToSpawn.Humanoid.Died:Connect(function()
player.Character.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame
end)

    local success, canStart, Units = pcall(function()
        return UnitsRequest:InvokeClient(player)
    end)

    if not success or not canStart or not Units then
        warn("Units request failed for player: ".. player.Name)
        return
    end
    
    for _, unit in ipairs(Units) do
        print(unit.Name)
        local unitClone = ReplicatedStorage.Noobs:FindFirstChild(unit.Name)
        if unitClone then
            local clone:Model = unitClone:Clone()
            clone.Parent = map.Units
            local spawnOBJ = map.TowerSpawns:GetChildren()[math.random(1,#map.TowerSpawns:GetChildren())]
            clone.PrimaryPart.CFrame = spawnOBJ.CFrame + Vector3.new(0,5,0)
            clone:ScaleTo(0.3)
            
            clone.Humanoid.Died:Connect(function()
                clone:Destroy()
                unit:Destroy()
            end)

            unitModule.Start(clone,bossToSpawn)
        end
    end
else
    warn("Boss: " .. boss .." Doesn't exist")
end

end

return boss

tame yew
#

do you mismatch keys

#

Types

turbid lotus
#

?

tame yew
#

Not reading all that already sorry

tame yew
#

before sending

#

and after recieving

turbid lotus
#

I have print in local and serwer

#

20:23:11.617 Boss started - Server - Boss:13
20:23:11.650 Noob - Client - SetUnits:65
20:23:11.650 Ring Noob - Client - SetUnits:65
20:23:11.650 Noob - Client - SetUnits:65
20:23:11.650 Ring Noob - Client - SetUnits:65
20:23:11.668 Noob - Server - Boss:34

tame yew
#

You said table

turbid lotus
#

wait

#

20:29:16.087 table: 0x2793505da2d93123 (x4) - Client - SetUnits:65

vagrant stump
#

AI final boss evilcat