GUI not cloning and appearing

Hello, I’m AE_TG, and I am not good at GUIs. I made a script that would clone a GUI on the client’s side when a part was right-clicked, and that GUI would be moved to StarterGUI from ReplicatedStorage, and Enabled would become true. This is my server-side script:

clickD.RightMouseClick:Connect(function(plr)
	local rs = game:GetService("ReplicatedStorage")
	rs.GUIspawn:FireClient(plr, root) -- this is the HumanoidRootPart, which contains all of the attributes necessary for my script
end)

This is my LocalScript in StarterGUI:

local rs = game:GetService("ReplicatedStorage")
rs.GUIspawn.OnClientEvent:Connect(function(root)
	local desc = rs:WaitForChild("RCGUI"):Clone()
	local rDesc = desc.Stats
	rDesc.Description.Text = root:GetAttribute("Description")
	rDesc.Electrons.Text = root:GetAttribute("ElectronNumber")
	rDesc.SubstanceName.Text = root:GetAttribute("Name")
    desc.Parent = game:GetService("StarterGui")
	desc.Enabled = true
	print("Event run!")
end)

My organization of these instances:


HumanoidRootPart when all the attributes are there:

It does print Event run! but I don’t see the GUI. It is in StarterGUI and is enabled, I just can’t see it.

I can post more pictures if anyone wants. Please help!

1 Like

If you clone a GUI from ReplicatedStorage and place it in StarterGui, you would be giving that GUI to new incoming players, you should clone it and place it inside Player.PlayerGui to give it to the player

2 Likes

Moving it to StarterGui won’t really work because it’s what the player starts with, hence the name StarterGui. Try cloning the Gui to the player’s PlayerGui (game.Players.LocalPlayer.PlayerGui).

2 Likes

Oh btw, if you are already handling the gui giving on server side, would be better if you dont trigger the client to do the cloning, do it server side and store that GUI in ServerStorage, to keep things safer

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.