#Mana Cultivation Script

10 messages · Page 1 of 1 (latest)

minor perch
#

i made a script that do " when a player join the game a "Nucleo" appear in his UpperTorso as a Child of the Parent(UpperTorso) i also made the different color of the Nucleo that depends on the time the player spent on meditation , the problem is that when the player enter the game , the Nucleo doesn't appear in the UpperTorso i'd like to put the script but it is too long , how can i show it ?

#

as u can see there's no "Nucleo" inside the UpperTorso

runic knot
#

That’s all I can say with the given information

minor perch
#

should i send the script in different parts? cuz is long

runic knot
#

Or just send the relevant parts

minor perch
#

op , ur right

#

local function createNucleo(character)
local UpperTorso = character:WaitForChild("UpperTorso", 10) -- Attendere fino a 10 secondi per UpperTorso

if UpperTorso then
    local Nucleo = UpperTorso:FindFirstChild("Nucleo")

    if not Nucleo then
        Nucleo = Instance.new("Part")
        Nucleo.Name = "Nucleo"
        Nucleo.Size = Vector3.new(0.5, 0.5, 0.5)
        Nucleo.Shape = Enum.PartType.Ball
        Nucleo.Transparency = 0.4
        Nucleo.CanCollide = false
        Nucleo.Parent = UpperTorso

        print("Server: Nucleo created and assigned to UpperTorso for player", character.Parent.Name)
    else
        print("Server: Nucleo already exists for player", character.Parent.Name)
    end
else
    print("Server: UpperTorso not found for player", character.Parent.Name)
end

end

local function onPlayerAdded(player)
player.CharacterAdded:Connect(function(character)
print("Server: Character added for player", player.Name)
createNucleo(character)

    local Nucleo = character:WaitForChild("UpperTorso"):FindFirstChild("Nucleo")
    if Nucleo then
        print("Server: Nucleo found for player", player.Name)
    else
        print("Server: Nucleo not found for player", player.Name)
    end
end)

end

Players.PlayerAdded:Connect(onPlayerAdded)

#

i knew there's a method for sending the script in a better way , but i don't remember

runic knot
#

Why are you not using CharacterAdded?