I’m currently working on a plugin and this portion of the scripting needs the user to type a number (ex: 6) and it’ll generate the template I have set up 6 times with a number on the top right for each indicating which frame it is (to prevent confusion).
I’m unsure how to do this in a way for it to be compatible with Script.Source later on
I’m essentially looking for a method where when they type a number here and submit it: https://gyazo.com/8dd244440019da4ee56039a93353e547
It’ll create 6 of these frames, number each 1-6 (assuming you typed 6 in there) https://gyazo.com/38087be6fcf74eccbad9ab4c6964757c
and store it in a folder for organization
(each template will be named Page# according to it’s number)
and the left and right buttons in the screenshot above should be able to cycle through all of them
-- your plugin script
for page = 1, selectedNumber do
local clone = PageTemplate:Clone()
clone.Name = "Page" .. tostring(page)
clone.Parent = -- ... wherever
end
Obviously there are variables you need to fill out still.
You could then extract the page number from the name in a LocalScript inside the PageTemplate. After that you can just add/subtract 1 to get the previous and next page:
-- LocalScript in the PageTemplate
-- get page no. from name
local page = tonumber(script.Parent.Name:sub(5))
local nextPage = script.Parent.Parent:FindFirstChild("Page" .. tostring(page+1))
local prevPage = script.Parent.Parent:FindFirstChild("Page" .. tostring(page-1))