B0a0sti8_firstunityproject/Assets/Skripts/EnemyAndMinions/Spawning/SpawnTrainingsDummies.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Netcode;

public class SpawnTrainingsDummies : NetworkBehaviour
{
    [SerializeField] GameObject trainingsDummy;
    [SerializeField] Vector3 spawnPos1;
    [SerializeField] Vector3 spawnPos2;
    [SerializeField] Vector3 spawnPos3;
    [SerializeField] Vector3 spawnPos4;

    public override void OnNetworkSpawn()
    {
        base.OnNetworkSpawn();

        if (!IsServer)
        {
            return;
        }

        GameObject go = Instantiate(trainingsDummy, spawnPos1, Quaternion.identity);
        go.GetComponent<NetworkObject>().Spawn();

        GameObject go1 = Instantiate(trainingsDummy, spawnPos2, Quaternion.identity);
        go1.GetComponent<NetworkObject>().Spawn();

        GameObject go2 = Instantiate(trainingsDummy, spawnPos3, Quaternion.identity);
        go2.GetComponent<NetworkObject>().Spawn();

        GameObject go3 = Instantiate(trainingsDummy, spawnPos4, Quaternion.identity);
        go3.GetComponent<NetworkObject>().Spawn();
        go3.GetComponent<EnemyStats>().maxHealth.baseValue = 1;
    }
}
