Help With Cloning Frame

I’m trying to make a “tip” system where it clones a frame inside of a screen ui, renames it, and changes a few stats inside it. Currently, when I try to use the :Clone() variable inside of my script, it just replaces the current frame. I’ve tried to fix this by cloning other variables, but the result is the same.

Here is a video on what I mean:

Heres the script:

task.wait(5)

script.Parent.Template:Clone()
script.Parent.Template.Name = "F1"
task.wait(1)
script.Parent.F1.Visible = true

script.Parent.F1.Countdown.Text = "10"
task.wait(1)
script.Parent.F1.Countdown.Text = "9"
task.wait(1)
script.Parent.F1.Countdown.Text = "8"
task.wait(1)
script.Parent.F1.Countdown.Text = "7"
task.wait(1)
script.Parent.F1.Countdown.Text = "6"
task.wait(1)
script.Parent.F1.Countdown.Text = "5"
task.wait(1)
script.Parent.F1.Countdown.Text = "4"
task.wait(1)
script.Parent.F1.Countdown.Text = "3"
task.wait(1)
script.Parent.F1.Countdown.Text = "2"
task.wait(1)
script.Parent.F1.Countdown.Text = "1"
task.wait(1)
script.Parent.F1:Destroy()

task.wait(1)

script.Parent.Template:Clone()
script.Parent.Template.Name = "F1"
task.wait(1)
script.Parent.F1.Text = "Did you know that group members get special perks in-game?"
script.Parent.F1.Visible = true

script.Parent.F1.Countdown.Text = "10"
task.wait(1)
script.Parent.F1.Countdown.Text = "9"
task.wait(1)
script.Parent.F1.Countdown.Text = "8"
task.wait(1)
script.Parent.F1.Countdown.Text = "7"
task.wait(1)
script.Parent.F1.Countdown.Text = "6"
task.wait(1)
script.Parent.F1.Countdown.Text = "5"
task.wait(1)
script.Parent.F1.Countdown.Text = "4"
task.wait(1)
script.Parent.F1.Countdown.Text = "3"
task.wait(1)
script.Parent.F1.Countdown.Text = "2"
task.wait(1)
script.Parent.F1.Countdown.Text = "1"
task.wait(1)
script.Parent.F1:Destroy()

If anyone can help with this it would be greatly appreciated

This is a Horrible way of doing it, Its incredibly inefficient and useless.

local Holder = script.Parent

local Tips = { -- List of Tips Here
   "Did you know that group members get special perks in-game?", -- Tip 1
   "This is a Tip!" -- Tip 2
}

function Count(Time, Instance) -- 2 Arguments
   for i = Time,0,-1 do -- Countdown
      task.wait(1)
      Instance.Text = i -- Sets text as the number
   end
end

function NewTip()
   local Selected = Tips[math.random(1, #Tips)] -- selects a random tip
   print(Selected) -- Prints Selected Tip
   return Selected -- returns Data for Tip
end

local Clone = Template:Clone() -- New Template
Clone.Text = NewTip() -- Assigns New Tip
Clone.Parent = Holder -- Parents the Clone

Count(10, Clone) --  Counts down from 10 Seconds
-- Time = 10
-- Instance = Clone


Clone:Destroy() -- Destroys Clone
2 Likes

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