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

is it possible to add a script using instance.new and also add code to that script?

Asked by 5 years ago

i'm trying to create a text button and then input a local script into it as a child which will run the textbutton. Is there anyway to do this all in the same script that is creating the text button?

0
Yes it is possible to do both of those things. But the Source is limited to studio only as it is a http://wiki.roblox.com/index.php?title=API:ProtectedString User#5423 17 — 5y
0
But I am not sure you need this. You can connect any event for this new text button without any additional scripts. User#5423 17 — 5y

3 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Don't use a Instance its best to use spawn creates a script you can code in

 spawn(function()
    --Code
end)

For more info go to http://wiki.roblox.com/index.phptitle=Global_namespace/Roblox_namespace#spawn

Ad
Log in to vote
0
Answered by 5 years ago

You could also just make the gui then put it into ReplicatedStorage, Lightin, but not in starterGui, when you want to open the gui, put the gui you want to appear in the PlayerGui of the LocalPlayer, It's easier!

Log in to vote
0
Answered by 4 years ago

That would be a Coroutine

Answer this question