Can somebody help me? How do I make the GUI (Page) go back? I made this awesome book from scratch and it work just fine except I can't turn back to the previous page once I click next. I have tried to do it myself but it doesn't work. I made this GIF so you can see what I'm talking about, please check them before scrolling down:

https://gyazo.com/4ea3a271f459571e256a85e9b8ed9270

I also made a layout of the book too so please check them as well:

https://gyazo.com/17f91fdf5424d58098809a7c7407ac39

Here's is the script from the book (This is a Local Script):

https://gyazo.com/43068bf74b8fbdba56ffb80aa554aff6

Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")
Debris = game:GetService("Debris")
InsertService = game:GetService("InsertService")

BookGui = script:WaitForChild("BookGui")

ToolEquipped = false

function CheckIfAlive()
    return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end

function Activated()
    if not CheckIfAlive() then
        return
    end
    if BookGuiCopy and BookGuiCopy.Parent then
        return
    end
    local PlayerGui = Player:FindFirstChild("PlayerGui")
    if PlayerGui then
        BookGuiCopy = BookGui:Clone()
        BookGuiCopy.Parent = PlayerGui
    end
end

function Equipped(Mouse)
    Character = Tool.Parent
    Player = Players:GetPlayerFromCharacter(Character)
    Humanoid = Character:FindFirstChild("Humanoid")
    ToolEquipped = true
    if not CheckIfAlive() then
        return
    end
end

function Unequipped()
    if BookGuiCopy and BookGuiCopy.Parent then
        Debris:AddItem(BookGuiCopy, 0)
    end
    ToolEquipped = false
end

Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)

Here's another local script that go along with the book:

https://gyazo.com/4d0ea2b43ef554880b4c098593eaf979

ContentProvider = game:GetService("ContentProvider")

Gui = script.Parent
Frame = Gui:WaitForChild("Frame")
Next = Frame:WaitForChild("Next")
Back = Frame:WaitForChild("Back")

Pages = {}

CurrentPage = 1

for i, v in pairs(Frame:GetChildren()) do
	if ((v:IsA("TextButton") or v:IsA("ImageLabel")) and tonumber(v.Name)) then
		table.insert(Pages, v)
		ContentProvider:Preload(v.Image)
		v.Visible = false
	end
end

table.sort(Pages, (function(a, b)
	return tonumber(a.Name) < tonumber(b.Name)
end))

if Pages[1] then
	Pages[1].Visible = true
end

Next.MouseButton1Click:connect(function()
	if not Pages[1] then
		return
	end
	CurrentPage = (CurrentPage + 1)
	if not Pages[CurrentPage] then
		CurrentPage = 1
	end
	for ii, vv in pairs(Pages) do
		if ii == CurrentPage then
			vv.Visible = true
		else
			vv.Visible = false
		end
	end
end)

If you would like to take a closer look at the script, you can click the link below, it will take you straight to the model:

https://www.roblox.com/Flip-Page-item?id=487253954

Many thanks again, my friends!

1 comment

0

This is not a request site. A quick look at the script tells me that you are making no attempts to learn, as the answer is as simple as a quick copy-paste and a small edit.