Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Morphs not showing on other players screens?

So i reverse engineered a morph giver to be GUI controlled instead of a button you touch, i made it work but it doesnt show the welded parts on other players screens, you can see it welded to you on your screen but others can't see it welded on you. I don't know what to do lol please help

wait(1)
local Plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function(r)


if Plr.Character.UsingMorph.Value == true then
	Plr.Character.Leg2:remove()
	Plr.Character.Leg1:remove()
	Plr.Character.Chest:remove()
	Plr.Character.Arm2:remove()
	Plr.Character.Arm1:remove()
	Plr.Character:findFirstChild("Torso").Transparency = 0
Plr.Character:findFirstChild("Left Arm").Transparency = 0
Plr.Character:findFirstChild("Right Arm").Transparency = 0
Plr.Character:findFirstChild("Left Leg").Transparency = 0
Plr.Character:findFirstChild("Right Leg").Transparency = 0
	Plr.Character.UsingMorph.Value = false
	Plr.Character.Head.Transparency = 0


else
local modelname = script.Parent.Morphy 
	local Player = game.Players.LocalPlayer
Player.Character:findFirstChild("Head").Transparency = 0
Player.Character:findFirstChild("Torso").Transparency = 0
Player.Character:findFirstChild("Left Arm").Transparency = 0
Player.Character:findFirstChild("Right Arm").Transparency = 0
Player.Character:findFirstChild("Left Leg").Transparency = 0
Player.Character:findFirstChild("Right Leg").Transparency = 0

	if Player.Character:findFirstChild("Humanoid") ~= nil and Player.Character:findFirstChild("Morphy") == nil then
		local g = modelname.Chest:Clone()
		g.Parent = Player.Character
		Plr.Character.UsingMorph.Value = true
		local C = g:GetChildren()
		for i=1, #C do
			if C[i].className == "Costume" or "Union" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
				local Y = Instance.new("Weld")
				Y.Part0 = Player.Character.Torso
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false

		if Player.Character:findFirstChild("Humanoid") ~= nil and Player.Character:findFirstChild("Leg1") == nil then
		local g = modelname.Leg1:Clone()
		g.Parent = Player.Character
		local C = g:GetChildren()
		for i=1, #C do
			if C[i].className == "Costume" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
				local Y = Instance.new("Weld")
				Y.Part0 = Player.Character["Left Leg"]
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false
			if Player.Character:findFirstChild("Humanoid") ~= nil and Player.Character:findFirstChild("Leg2") == nil then
		local g = modelname.Leg2:Clone()
		g.Parent = Player.Character
		local C = g:GetChildren()
		for i=1, #C do
			if C[i].className == "Costume" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
				local Y = Instance.new("Weld")
				Y.Part0 = Player.Character["Right Leg"]
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false

if Player.Character:findFirstChild("Humanoid") ~= nil and Player.Character:findFirstChild("Arm1") == nil then
		local g = modelname.Arm1:Clone()
		g.Parent = Player.Character
		local C = g:GetChildren()
		for i=1, #C do
			if C[i].className == "Costume" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
				local Y = Instance.new("Weld")
				Y.Part0 = Player.Character["Left Arm"]
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false
	

	if Player.Character:findFirstChild("Humanoid") ~= nil and Player.Character:findFirstChild("Arm2") == nil then
		local g = modelname.Arm2:Clone()
		g.Parent = Player.Character
		local C = g:GetChildren()
		for i=1, #C do
			if C[i].className == "Costume" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
				local Y = Instance.new("Weld")
				Y.Part0 = Player.Character["Right Arm"]
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			h[i].Anchored = false
			h[i].CanCollide = false


			
			
			local d = Player.Character:GetChildren() 
	for i=1, #d do 
		if (d[i].className == "Accessory") then 
			d[i].Handle.Transparency = 0

		end
	end 


end		
end
end
end	
end 	
end	
end			
end	
end			
end
end
end)

1 answer

✓ Accepted answer

First things first, let's start with the setup to get everything ready before coding.

Step-up 1a. Create a RemoteEvent, put it in ReplicatedStorage. 1b. Name it whatever you want, preferably to something that reminds you what it's for such as 'MorphRemote'. 2a. Create a LocalScript, preferably put it in the UI you have made. 3a. Create a ServerScript, place it in ServerScriptService. 4a. Place your morph elsewhere, such as ServerStorage.

LocalScript

-- [[ MAIN VARIABLES ]] --
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()

-- [[ SERVICES ]] --
RS = game:GetService('ReplicatedStorage')

-- [[ SIDE VARIABLES ]] --
Remote = RS:WaitForChild('MorphRemote')
Button = script.Parent

-- [[ MAIN SCRIPT ]] --

Button.MouseButton1Click:Connect(function()
	Remote:FireServer()
end) -- button end

ServerScript

-- [[ SERVICES ]] --
RS = game:GetService('ReplicatedStorage')
SS = game:GetService('ServerStorage')

-- [[ SIDE VARIABLES ]] --
Remote = RS:WaitForChild('MorphRemote')
Morph = SS:WaitForChild('Morphy')
-- [[ MAIN SCRIPT ]] --

function MorphHandler(Player) -- player is automatically a given variable
	local Character = Player.Character or Player.CharacterAdded:Wait()
	
	if Character:WaitForChild('UsingMorph').Value == true then
		Character.UsingMorph.Value = false
		for _,limb in pairs(Character:GetChildren()) do
			if limb:IsA('BasePart') then
				limb.Transparency = 0
			end -- check children class
		end -- loop
		-- delete morph
		if Character:FindFirstChild('Chest') then Character.Chest:Destroy() end
		if Character:FindFirstChild('Arm1') then Character.Arm1:Destroy() end
		if Character:FindFirstChild('Arm2') then Character.Arm2:Destroy() end
		if Character:FindFirstChild('Leg1') then Character.Leg1:Destroy() end
		if Character:FindFirstChild('Leg2') then Character.Leg2:Destroy() end
	elseif Character:WaitForChild('UsingMorph').Value == false then
		Character.UsingMorph.Value = true
		for _,limb in pairs(Character:GetChildren()) do
			if limb:IsA('BasePart') then
				limb.Transparency = 1
			end -- check children class
		end -- loop

		local modelname = Morph:Clone()

		-- PUT THE REST OF YOUR MORPH CODE HERE

	end -- check if using morph
end -- function end


-- [[ CONNECTIONS ]] --

Remote.OnServerEvent:Connect(MorphHandler)

7 comments

0

How do i do that?

0

I shall edit the answer accordingly to help you.

0

Try this, should work.

0

Thank you so much!

0

It says "- Infinite yield possible on 'ReplicatedStorage:WaitForChild" I'm not quite sure how to fix that i'm not use to doing remote events.

0

Have you created a RemoteEvent and named it 'MorphRemote'?

0

Yeah

This discussion is preserved as it was. New answers, comments, and votes are closed.