Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I show a button at the end of a tween loop?

Asked by 5 years ago

I need help to figure out how to show a Button at the end of a Tween Loop?

The loop has 14 sayings, at the end, I want it to go back to a button that says Reset, so when Reset button is clicked, it will then go to the Beginning Button. I have the Beginning Button starting out, with a remove script on it, so when that button is clicked, it then shows the tween loop (slideshow). I then want the Reset button to show at the end of that loop AND when the Reset button is pressed, I want it to go back to the Beginning Button!

Script for Remove Beginning Button:

local function OnClicked() script.Parent:Remove() end

script.Parent.MouseButton1Click:connect(OnClicked)


Script for Tween Loop: (got it from Shiro75)

--< variables local label1 = script.Parent.SurfaceGui.Frame.label1 local label2 = script.Parent.SurfaceGui.Frame.label2 local using = label1

--< dialogue local say = {"Expediton Guide Training Tutorial", "Loading...", "Ok, Guides, Be sure to gear up for your Expedition!", "Post an Expedition shout on the c0rd and Roblox group.", "Gather climbers who want your help.", "Remember not to advertise on the radio. Ask climbers if they want to join, face to face.", "Have all Climbers line up SFL (Single File Line) behind you.", "Be sure to get a Screenshot before you take off and also when you summit.", "Check each Climber for proper gear.", "Do Climbers have the Oxygen Mask? Is their Flow OFF?", "Do Climbers have Helmets? Is their White Light ON?", "The Red Light on the Helmet is for emergencies only.", "Can Climbers use the Radio? Have them do Test in the Radio to check.", "State all your rules to the Climbers.", "The Number One Most Important Rule: Climbers must stay behind the Guide at all times.", "If you have a Climber who will not listen, tell them kindly but firmly, they cannot join your Expedition.", "Best Wishes to a Successful Expedition, Twin Peaks Guide! You can do it!", "End of Training"}

--< move function (tween) local function move(obj, pos) obj:TweenPosition(pos, "InOut", "Quad", 1, false)

end

while true do --< dialogue runner (for loop) for s = 1, #say do

--< reposition, change text, and move current label onto screen
using.Position = UDim2.new(-1, 0, 0, 0)
using.Text = say[s]
move(using, UDim2.new(0, 0, 0, 0))


--< prepare next label
if using == label1 then
    using = label2
else
    using = label1
end

--< move old/next label off the screen
move(using, UDim2.new(1, 0, 0, 0))

wait(1)

end end


Any help would be awesome!

0
It would be easier to read and understand if you put it in a code block. I would be able to help you if you put your code in a code block. popeeyy 493 — 5y
0
popeeyy---Please look at the scripts in my answer below this question! Thanks! jmstandridge -2 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Script to remove GuidesButton:

local function OnClicked()
    script.Parent:Remove()
end

script.Parent.MouseButton1Click:connect(OnClicked)

Script for Tween Loop:

--< variables
local label1 = script.Parent.SurfaceGui.Frame.label1
local label2 = script.Parent.SurfaceGui.Frame.label2
local using = label1

--< dialogue
local say = {"Expediton Guide Training Tutorial", "Loading...", "Ok, Guides, Be sure to gear up for your Expedition!", "Post an Expedition shout on the c0rd and Roblox group.", "Gather climbers who want your help.", "Remember not to advertise on the radio. Ask climbers if they want to join, face to face.", "Have all Climbers line up SFL (Single File Line) behind you.", "Be sure to get a Screenshot before you take off and also when you summit.", "Check each Climber for proper gear.", "Do Climbers have the Oxygen Mask? Is their Flow OFF?", "Do Climbers have Helmets? Is their White Light ON?", "The Red Light on the Helmet is for emergencies only.", "Can Climbers use the Radio? Have them do *Test* in the Radio to check.", "State all your rules to the Climbers.", "The Number One Most Important Rule: Climbers must stay behind the Guide at all times.", "If you have a Climber who will not listen, tell them kindly but firmly, they cannot join your Expedition.", "Best Wishes to a Successful Expedition, Twin Peaks Guide! You can do it!", "End of Training"}

--< move function (tween)
local function move(obj, pos)
    obj:TweenPosition(pos, "InOut", "Quad", 2)
end

while true do
--< dialogue runner (for loop)
for s = 1, #say do

    --< reposition, change text, and move current label onto screen
    using.Position = UDim2.new(-1, 0, 0, 0)
    using.Text = say[s]
    move(using, UDim2.new(0, 0, 0, 0))

    --< prepare next label
    if using == label1 then
        using = label2
    else
        using = label1
    end

    --< move old/next label off the screen
    move(using, UDim2.new(1, 0, 0, 0))

    wait(5)

end
end

--< Shiro75 >--
Ad

Answer this question