Any chance someone could help me convert this to FE? It's a morph button

local Button = script.Parent
local Assets = script.Parent.Parent.Parent.Assets
local plr = script.Parent.Parent.Parent.Parent.Parent.Character
local Head = plr.Head
local Teleporter = game.Workspace.Teleporter
local Player = script.Parent.Parent.Parent.Parent.Parent



if Player:GetRankInGroup(3057001) >= 1 and Player:IsInGroup(3057001) then
	Button.Visible = true
end

function MouseEnter()
	Button.Parent.Parent.PictureFrame.Trooper.Visible = true
end

function MouseLeave()
	Button.Parent.Parent.PictureFrame.Trooper.Visible = false
end

function GiveUniform() 
		local h = Assets.Standard.Trooper.Helmet:clone()
		for i,v in pairs(h:children()) do
			local W = Instance.new("Weld")
			W.Part0 = h.Middle
			W.Part1 = v
			local CJ = CFrame.new(h.Middle.Position)
			local C0 = h.Middle.CFrame:inverse()*CJ
			local C1 = v.CFrame:inverse()*CJ
			W.C0 = C0
			W.C1 = C1
			W.Parent = h.Middle
		end
		local bweld = Instance.new("Weld")
		bweld.Part0= Head
		bweld.Part1=h.Middle
		h.Middle.Anchored=false
		h.Middle.Transparency = 0
		bweld.C1=CFrame.new(0,0,0)
		bweld.Parent=h.Middle
		h.Middle.CFrame=Head.CFrame*CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
		for i,v in pairs(h:children()) do
			v.Anchored=false
		end
		h.Parent=plr
		for i,v in pairs(h:children()) do
			v.CanCollide=false
		end
		Head.Transparency = 1
		plr.Head.face:remove()
		
		local d = plr:GetChildren()
		for i=1, #d do 
			if (d[i].className == "Accessory") then 
				d[i]:remove() 
			end 
		end
	
		local sh = Assets.Standard.Trooper.Shirt:clone()
		plr.Shirt:remove()
		sh.Parent = plr
		
		local pan = Assets.Standard.Trooper.Pants:clone()
		plr.Pants:remove()
		pan.Parent = plr
		
		plr:MoveTo(Teleporter.Position)
		
		script.Parent.Parent.Parent:remove()
end


Button.MouseButton1Down:connect(GiveUniform)
Button.MouseEnter:connect(MouseEnter)
Button.MouseLeave:connect(MouseLeave)

1 comment

0

Why don't you convert it yourself?