Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

onSPAWN Morphing - HELP?

Asked by
iLegitus 130
10 years ago

Im trying to make a script that spawns a player with a morph (Not meshes) such as ROBLOXIAN 2.0...

Ive tried...Help?

I have built the character (What it will spawn as) but i have absolutley no idea on how to spawn the character (onSpawn),With bricks... Ive tried :

--Made by Micacalt

function Intialize(character)
    for i, child in pairs(script:GetChildren()) do
        if child.className == "Script" or child.className == "LocalScript" then --Get the Robloxian 2.0 Morpher script
            local c = child:Clone() --clones inside the player
            c.Parent = character
            c.Disabled = false
        end
    end
end

function Apply(obj)
    if obj.className == "Humanoid" and obj.Health > 0 and obj.MaxHealth > 0 then --if player dies loop script on respawn
        Intialize(obj.Parent)
    end
    for i, child in pairs(obj:GetChildren()) do
        Apply(child) --if there are multiple characters without colour, replace them with default colours
    end
end

Apply(game.Workspace)
game.Workspace.ChildAdded:connect(Apply) --when a character joins loop script

Im very very idiotic on this...I have no idea what i tried but i need some help! So please could you help me out? Im simply asking on how i should make it?

Answer this question