#Auto Morph
1 messages · Page 1 of 1 (latest)
Heres the code:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MorphsFolder = ReplicatedStorage:WaitForChild("Morphs")
local function applyFullMorph(player, morphName)
local oldChar = player.Character
if not oldChar then return end
local morphTemplate = MorphsFolder:FindFirstChild(morphName)
if not morphTemplate then
warn("Morph model not found:", morphName)
return
end
if not morphTemplate:FindFirstChild("HumanoidRootPart") or not morphTemplate:FindFirstChildWhichIsA("Humanoid") then
warn("Morph model is missing HumanoidRootPart or Humanoid.")
return
end
print("[MORPH] Replacing character with:", morphName)
local newChar = morphTemplate:Clone()
newChar.Name = player.Name
newChar.Parent = workspace
-- Ensure PrimaryPart is set
if not newChar.PrimaryPart then
newChar.PrimaryPart = newChar:FindFirstChild("HumanoidRootPart")
end
-- Position at old character’s location
local spawnCFrame = oldChar:FindFirstChild("HumanoidRootPart") and oldChar.HumanoidRootPart.CFrame or CFrame.new(0, 10, 0)
newChar:PivotTo(spawnCFrame)
-- Fully replace character
player.Character = newChar
end
-- Remote setup
local function createMorphRemote(eventName)
local remote = Instance.new("RemoteEvent")
remote.Name = eventName
remote.Parent = ReplicatedStorage
remote.OnServerEvent:Connect(function(player, morphName)
print("[REMOTE CALL] Morph requested:", morphName, "by", player.Name)
pcall(function()
applyFullMorph(player, morphName)
end)
end)
end
createMorphRemote("Morph_Selection_Trigger")
createMorphRemote("CustomMorph_Selection_Trigger")
createMorphRemote("DivMorph_Selection_Trigger")
These lines help anchor the player without being as glitchy as anchor
humanoid.PlatformStand = true
humanoid:ChangeState(Enum.HumanoidStateType.Physics)
keep in mind it doesn’t let the player move, but you can just undo it
is there a way to let players move? I need it for a game
Maybe you can move the morph up a little bit? Like 2 to 5 studs so it doesn’t fall through?
I can try but it was spawning like on my character and falling off me thru the map