I am trying to make a billboard gui that has a button so I put it in player gui. in my script, I’m trying to clone it but it is not doing that and I don’t know what to do.
-- some of the script
function buildings.new(creator: Player, cframe: CFrame)
creator = creator,
gui = creator.PlayerGui:WaitForChild("Object Gui"):Clone(), -- not cloning
model = newModel(logModel, creator.TeamColor.Color, cframe)
local creator: Player = self.creator
self.gui.Enabled = true
self.gui.Adornee = self.model.Log
self.money = 0
self.gui.Main["Name & money"].Text = string.format("%s's %s that gained $%d", self.creator.Name, self.model:GetAttribute("name"), self.money)
local btn: TextButton = self.gui.Main.Sell
btn.Text = string.format("Sell for $%d", self.model:GetAttribute("price") * 0.8)
while task.wait(self.model:GetAttribute("waitTime")) and self.model do
(its not cloning or setting the adornee)
there are no errors so im confused and i hope this is enough for someone to help
Where are you parenting the billboard GUI?
its in starter gui, and im setting the adornee to a part
its a local or server script??
I think you still need to set a part as the parent of the clone.
the script is in serverscriptservice and a local script is in the button so i can click
Wel i did it again in the startergui but it didnt work, but if i put the billboard into worspace, it does clone
yes but then I can not click on the button
You could use a remote event …
Yes i am using a remote event, but how does that relate to this
nothing happened + no errors before so couldn’t have been that
Are you sure “creator” is the instance of the player? it could be the name
I renamed “creator” to “player” in the module script
here is the server script:
local mod = require(script.Parent.Buildings)
local m = mod.new(player, CFrame.new(-10, 0.75, 0))
Billboard guis are for rendering a 2d image in the 3d workspace environment. If you were to use a screengui you could add it to the player GUI during runtime.
And then the local script and button would work.
are you suggesting using a screengui? or are you saying something else
I’m a little confused as to what specifically you want to achieve.
If you want a billboard to pop up on a part, use a billboardGui and parent it to the part, but scripts will need to be serverside.
If you want a button to appear on the player GUI simply placing a screengui into starter characterscripts will do this when the character loads and run local scripts.
If you want an event to add the button to the player GUI, then clone a screengui from serverstorage/replicated storage to the player GUI, and this will let you use local scripts as soon as it is parented there.
I am trying to make the billboard gui cloned so I can have multiple with the
building.new. The reason it is set in the player-gui is so I can have buttons to work (which does not work on places like workspace, because of local scripts only able to be in player-gui, player-tools etc).
Ok, thanks, so if you:
Change the billboardgui to a screengui and put it in replicated storage.
When you run building.new clone the screengui and parent it to the player GUI.
This should give you the effect you want. Local scripts will work once cloned and reparented.
if you wanted to have multiple screengui at the same time they would overlap, so might be better to clone a frame and put it into a screengui with preset UI layouts
Thanks, but I still used the billboard gui. I forgot that replicated storage can have both server and client see (and not one or the other)