Help With Making A Morph command

i want to make a morph command but dont know how
so if someone can help me i would appreciate it

what does it do:

  1. type: /morph PLAYERNAME MORPHNAME
  2. the morphs are stored in “serverstorage” in a folder called “morphs” with dummy’s
  3. only players you put in the script can use it
3 Likes

Screenshot_10

1 Like

example:

/morph player1 tree

so i want to make a command that does that

here is the code i tried but didn’t work:
local players = {
‘player1’,
‘player2’,
‘player3’,
‘player4’,
‘player5’
}

local function can_use(player)
local player_name = player.Name:lower()
for i = 1, #players do
if players[i] == player_name then
return true
end
end
end

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local player = game.Players:GetPlayerFromCharacter(character)
local player_name = player.Name:lower()
if can_use(player) then
local morph_folder = game.ServerStorage:WaitForChild(‘Morphs’)
local morph_list = morph_folder:GetChildren()
local chat = game.ReplicatedStorage:WaitForChild(‘Chat’)
chat.SayMessageRequest:connect(function(msg, recipient)
local args = msg:split(’ ')
if args[1] == ‘/morph’ and args[2] == player_name then
local morph_name = args[3]:lower()
for i = 1, #morph_list do
local morph = morph_list[i]
if morph.Name:lower() == morph_name then
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:FindFirstChild(‘Humanoid’)
if humanoid and humanoid.Health > 0 then
humanoid:Destroy()
end
morph:Clone().Parent = character
end
end
end
end)
end
end)
end)

It has an error on the “morph:Clone().Parent = character”
that it doesn’t have a parent
so i would appreciate if someone could help me with this

1 Like