So I'm trying to make a game where clicking on a button on a part starts a script.
My script that activates when the button is clicked:
01 | local dup = game.Workspace |
02 | local T = . 5 |
03 | local size = Vector 3. new ( 5 , 5 , 5 ) |
04 |
05 | function REP () |
06 | while true do |
07 | local part = Instance.new( "Part" , dup) |
08 | wait() |
09 | part.Anchored = false |
10 | part.Transparency = T |
11 | part.BrickColor = BrickColor.new ( 'Baby blue' ) |
12 | part.Reflectance = T |
13 | part.Material = ( "Glass" ) |
14 | part.Size = size |
15 | if wait = = 0 then |
How do I script a surfaceGui textbutton to run this script when clicked on?
Are you trying to make a click Detector To Pull Up A remote Function Or Remote event To Fire A GUI?