Posted
I'm utter garbage at Roblox Lua and normal lua. I am also bad at explaining so here's an example of what im looking for; lets say I have a script, topkek for example in a function. I want the ablilty to be able to click a button and have topkek stop running, have another button to resume topkek, and this needs to happen mutiple times how would I go about this, and is it even possible?
Was on WRD front page
Programs I own - Synapse X, Protosmasher, Sirhurt, Sweat Heart of Sigma Chi, Scriptware V2
Languages I know - C#,JS,Lua,VB.net
Learning - Python, C
Replied
The most effective way that I think you could achieve this, is by storing the events, and then disconnecting and connecting them depending on the state for that script. Also, for the GUI you could simply disable it. I'm not good with coding/scripting, but this might give you an idea.
Cancel
Post
Proud creator of: WRD+
Replied
I'm not really sure if this is what you're after, but just like @PoopMaster said, you can simply just toggle the 'Enabled' property of the ScreenGui.
For example:
Button 1:
local stop = TextButton1 --Assuming this is your textbutton to stop the Gui
local gui = ScreenGui --Assuming this is your ScreenGui
stop.MouseButton1Down:connect(function()
gui.Enabled = false
end)
Button 2:
local resume = TextButton2 --Assuming this is your textbutton to resume the Gui
local gui = ScreenGui --Assuming this is your ScreenGui
resume.MouseButton1Down:connect(function()
gui.Enabled = true
end)
If you have any questions, feel free to mention me in your reply, or add me on Discord: Xydix#4338
Cancel
Post
New account: NotZyrex
Replied
Well, I think he meant like toggling the execution/script within the function, so yeah. I don't think it's possible. Although, coroutines do provide yield, which kinda works that way.
Cancel
Post
Proud creator of: WRD+
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post