Skip to content

Instantly share code, notes, and snippets.

@EpicBoyX
Created August 15, 2021 12:59
Show Gist options
  • Save EpicBoyX/3d0b148e0d4788ddd3ce350746728ef3 to your computer and use it in GitHub Desktop.
Save EpicBoyX/3d0b148e0d4788ddd3ce350746728ef3 to your computer and use it in GitHub Desktop.
roblox morph script
local pad = script.Parent
local characterName = "Insert Character Model Name Here"
local character = pad.Parent:WaitForChild(characterName)
local debounce = true
pad.Touched:Connect(function(obj)
local plr = game.Players:GetPlayerFromCharacter(obj.Parent)
if plr and debounce == true then
debounce = false
pad.BrickColor = BrickColor.new("Really red")
local charClone = character:Clone()
charClone.Name = plr.Name
plr.Character = charClone
local rootPart = charClone:FindFirstChild("HumanoidRootPart") or charClone:FindFirstChild("Torso")
local plrRoot = obj.Parent:FindFirstChild("HumanoidRootPart") or obj.Parent:FindFirstChild("Torso")
if rootPart and plrRoot then
rootPart.CFrame = plrRoot.CFrame
end
charClone.Parent = workspace
wait(.5)
pad.BrickColor = BrickColor.new("Lime green")
debounce = true
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment