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

How do I make a SurfaceGUI text button activate this script when the button is clicked on?

Asked by 4 years ago

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:

local dup = game.Workspace
local T = .5
local size = Vector3.new (5,5,5)

function REP ()
    while true do
        local part = Instance.new("Part", dup)
        wait()
        part.Anchored = false
        part.Transparency = T
        part.BrickColor = BrickColor.new ('Baby blue')
        part.Reflectance = T
        part.Material = ("Glass")
        part.Size = size
        if wait == 0 then
            part.Anchored = false

        end
    end
end

REP()

How do I script a surfaceGui textbutton to run this script when clicked on?

0
Try using Mouse.Button1Down:Connect(function() Lucasmel08 7 — 4y
0
If so You can make a script to access Replicated Storage And Then name an event And Make A script to fire the event and the event will launch the script/GUI You need for a menu to pop up DestroyerSwag101 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Are you trying to make a click Detector To Pull Up A remote Function Or Remote event To Fire A GUI?

Ad

Answer this question