#wha ru i do?
1 messages · Page 1 of 1 (latest)
local frame = script.Parent :: Frame
local left_button = frame:WaitForChild("Left") :: TextButton
local right_button = frame:WaitForChild("Right") :: TextButton
local current_page = 1
local function update_frame(value)
if not frame:FindFirstChild(current_page+value) then return end
current_page += value
for _,v in pairs(frame:GetChildren()) do
if v:IsA("Frame") then
if v.Name == tostring(current_page) then
v.Visible = true
else
v.Visible = false
end
end
end
end
left_button.Activated:Connect(function()
update_frame(-1)
end)
right_button.Activated:Connect(function()
update_frame(1)
end)
this code are better to handle the gui, make localscript in Frame.
it works!!!11!1 had to do some fixes both in the script and workspace, but it seems to work flawlessly, thank you so much plural fruit guy C:
wait no how does it stop me from getting the value all the way to 0 or negatives numbers, is there even a cap, @outer falcon ?
if not frame:FindFirstChild(current_page+value) then return end
if it not found a name it pass
** You are now Level 3! **