Hey there
I’m using this script to clone a GUI that is shown in the GIF below. There are 6 Packages. If I click any of the packages, the GUI will pop up as it should, but if I choose a second, third, fourth, fifth and sixth, the ‘scroll_note’ no longer shows.
I’ve figured out that it’s because ‘scroll_note’ is still in the player GUI once it’s closed, but I’m not really the best with code and I’m not sure of the best way to destroy the GUI after perhaps 20 seconds.
b = script.Parent
local cd = b.ClickDetector
scroll_note = b:WaitForChild("scroll_note")
cd.MouseClick:connect(function(c)
if c then
if not c.PlayerGui:FindFirstChild("scroll_note") then
local g = scroll_note:Clone()
g.cutoff.Frame.scroll.TextLabel.TextWrapped = true
g.cutoff.Frame.scroll.TextLabel.Text = text
g.Parent = c.PlayerGui
end
end
end)
If anyone could offer a hand that would be great!
Thanks for reading!!
Gif: https://gyazo.com/7cac98236cf1e19335abee88334c6ad5
What’s the script you use to remove the GUI off your screen, and are there any errors in output once you click the second box?
There is no script used to remove the GUI, unless you’re referring to the ‘close’ button, which is here:
g = script.Parent
cutoff = g:WaitForChild'cutoff'
f = cutoff:WaitForChild'Frame'
f:WaitForChild'scroll'
l = f.scroll:WaitForChild'TextLabel'
f:WaitForChild'buttons'
close = f.buttons:WaitForChild'close'
cutoff_start = 128
cutoff_end = 562
originalpos = cutoff.Position
closing=false
close.MouseButton1Click:connect(function()
hidef()
closing=true
end)
function showf()
script.scrollunroll.Pitch = math.random(900,1100)/1000
script.scrollunroll:Play()
close.Visible = true
cutoff.Visible = false
cutoff.Position = UDim2.new(0.5,-300,0,-300)
cutoff.Visible = true
cutoff:TweenPosition(
originalpos
, "In", "Quad", .5, true, nil
)
wait(.51)
cutoff.Size = UDim2.new(0,600,0,cutoff_start)
cutoff:TweenSize(
UDim2.new(0,600,0,cutoff_end)
, "Out", "Quad", .8, true, nil
)
end
function hidef()
if closing then return end
script.scrollroll.Pitch = math.random(900,1100)/1000
script.scrollroll:Play()
cutoff:TweenSize(
UDim2.new(0,600,0,cutoff_start)
, "Out", "Quad", .3, true, nil
)
wait(.31)
cutoff:TweenPosition(
UDim2.new(0.5,-300,0,-300)
, "Out", "Quad", .3, true, nil
)
wait(.31)
cutoff.Visible = false
g:Destroy()
end
showf()```
Looking at your code, it seems you have one server-sided script and one client sided script. Basically what is happening is, Server-Puts it on screen, Client-destroys, Server-Still thinks it is there, Server-Doesn’t clone. You would need to do them both on the client side, or both on the server side. You can’t mix them or they will think otherwise.