How to make a GUI visible when you morph into a certain morph

I want it so when the player morphs into a certain morph a screen GUI pops up and if they change characters or reset it disappears. I don’t know how to do this. I tried searching for how to do it I found nothing.

Here is the morph script:

local changeEvent = game.ReplicatedStorage:WaitForChild("ChangePlayerCharacter")

local charsFolder = game.ReplicatedStorage:WaitForChild("Characters")

changeEvent.OnServerEvent:Connect(function(player,chosenCharacter)
	if charsFolder:FindFirstChild(chosenCharacter) then
		local newChar = charsFolder:FindFirstChild(chosenCharacter):Clone()
		local plrChar = player.Character

		if newChar:FindFirstChild("HumanoidRootPart") then
			newChar.PrimaryPart = newChar.HumanoidRootPart
			newChar:SetPrimaryPartCFrame(plrChar.HumanoidRootPart.CFrame)
		elseif newChar:FindFirstChild("Torso") and not newChar:FindFirstChild("HumanoidRootPart") then
			newChar.PrimaryPart = newChar.Torso
			newChar:SetPrimaryPartCFrame(plrChar.Torso.CFrame)
		end


		newChar.Name = player.Name
		player.Character = newChar

		local rootPart = newChar:FindFirstChild("HumanoidRootPart") or newChar:FindFirstChild("Torso")
		local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or player.Character:FindFirstChild("Torso")

		if rootPart and plrRoot then
			rootPart.CFrame = plrRoot.CFrame
		end

		newChar.Parent = workspace
	else
		warn("character doesnt exist or something went wrong.")
	end
end)
1 Like

When they touch it get the player by doing :GetPlayerFromCharacter(Character) and make the gui visible from there.

You’d do something like this inside that function:

game.ReplicatedStorage.MorphedGui:Clone().Parent = player.PlayerGui

This assumes you have a ScreenGui named “MorphGui” under ReplicatedStorage.
Make sure you have the “ResetOnSpawn” property set to true.

You’d put this right after where it says newChar.Parent = workspace

I want to have multiply GUI that one script controls all morphing so how could I make it so I can have multiple GUIs each one for a different morph.