Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

2 comments

0

Try using Mouse.Button1Down:Connect(function()

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

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.