Cloned GUI Not Appearing

I am attempting to make a 911 call system, where someone submits a 911 call through a phone, then it is sent to a MDT visible to all Law Enforcement Officers.

When I clone it, it works, everything is cloned, and sent to ScreenGUI, but it won’t show up. You can view that image below. The code that clones can be viewed below.

			if teamReq == 'Police' then
				print('hi')
				local clonedBtn = game.StarterGui.MDTSystem.LEOMDT.MainFrame.mainScreen.activeCallsScroll.Template:Clone()
				clonedBtn.Parent = game.StarterGui.MDTSystem.LEOMDT.MainFrame.mainScreen.activeCallsScroll
				clonedBtn.Name = 'Call #' ..  serverCallNumb
				clonedBtn.Text = 'Call #' .. serverCallNumb
				clonedBtn.Description.Value = filteredDescription
				clonedBtn.Location.Value = filteredLocation
				clonedBtn.Username.Value = player.Name
				clonedBtn.Visible = true
				clonedBtn.Position = UDim2.new(game.StarterGui.MDTSystem.LEOMDT.MainFrame.mainScreen.activeCallsScroll.AbsolutePosition)
				print(clonedBtn)
			end

Any help is appreciated

1 Like

thought it is better to use PlayerGui than StarterGui because GUI doesn’t stay on where you think it is, You are trying to clone and parent them where they’re not actual client so it’s live rendered through each local players inside PlayerGui as they’re cloned from StarterGui even if you attempt to use RunService.

local playerSV = game:GetService("Players")
local playerCRV = playerSV.LocalPlayer --Gets client player (works for localscript)
local playerGUI = playerCRV.PlayerGui --Where GUI renders to each player client

-- the rest of your code here

I just figured starter gui would apply to everyone who can see that guy, as im trying to push it out to everyone, not just one local player

I guess an alternative may be looping through every player to see if they have that, but that seems terribly ineffective and consuming on the server

1 Like

StarterGui if you actually read the Starter part of it is exactly what It sounds like, Its the Starter Gui (which is the User Interface) given to each Player on Join or on Respawn which is held under PlayerGui, which is a basically a local StarterGui under the Player Instance that Allows the Interface to be Rendered on their Screen, Its a common thing for Beginners to do with their code, and sometimes a mistake made by more experienced Developers, But you dont seem like a Beginner, but more experienced, I’m not sure where you got the Idea of StarterGui being Shared Between Everyone, It isn’t, and It would be completely wrong to assume that. Plus, It wouldn’t be cool if you saw everybody using the exact same Gui, IT WOULD BE A MESS.

The Gui you see on the Server or in Studio Mode is the Preview of the Gui being Rendered from StarterGui which can be turned off at any time within its Properties.

Instead, you should think of It like a Starter Kit, you are given this kit when you Join or Start a game in a specific Gamemode for you to use and get a Head start in this game for you to use.
You are Basically Modifying the Starter Kit rather than Modifying the Player’s already given kit, which is something that you shouldn’t be doing if you want an Effect to be Visible on the Client.

This would Actually be a Horrible Use of the Server to check if they have something they SHOULD already have been given from StarterGui, If you are planning to Apply something to ALL of the Clients, Use a RemoteEvent for this purpose.

1 Like

The original 911 call is triggered by a remote event, and is secured, is there a way the same remote event could be used for that, or do you think it would be better for two different remotes.

And I don’t quite understand how we would use that remote event for that purpose, took a break from Lua for a while, and after returning to it, I don’t quite remember how to do everything.

1 Like

Try to use PlayerGui and see if its works

I store frames that get cloned in to the UI regularly in “ReplicatedStorage”, under a folder called “UI”, so all users have a copy and they are simple to reference, no hunting around for stuff stored randomly. The clients simply clone the items from there:
image

1 Like

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