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

resume button not resuming properly?

Asked by 4 years ago
Edited 4 years ago

So i made a textlabel that changes the text every few seconds and added pause and unpause buttons to it. Whenever I unpause though, the text changing cycle restarts. Anyone know how to fix this?

the code for the unpause button:

script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.Parent.Parent.ScreenGui.Textlabel.Disabled == true then
script.Parent.Parent.Parent.Parent.ScreenGui.Textlabel.Disabled = false
end
end)

my ¨resume¨ gui only resumes when the player touches a part, which is teleported to when the unpause button is pressed. The part triggers a remote event which activates this script in screengui:

local active = false
game:GetService(¨ReplicatedStorage¨):WaitForChild(¨RemoteEvent¨).OnClient:Connect(function()
if active == false then
active = true
script.Parent.Parent.Textlabel.Text = ¨1¨
wait(1.5)
script.Parent.Parent.Textlabel.Text = ¨2¨
wait(1.5)
script.Parent.Parent.Textlabel.Text = ¨3¨
wait(1.5)
script.Parent.Parent.Textlabel.Text = ¨4¨
wait(1.5)
script.Parent.Parent.Textlabel.Text = ¨5¨
wait(1.5)

anyone have any idea on how to make it start from where i paused it?

0
We cant do anything without the code, please add it. Benbebop 1049 — 4y

Answer this question