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

How can I turn a button dialogue into a gui? (Details in description)

So I am making a border game and im gonna make a gui where if you click that text button it makes you say the dialogue, In this case I am using my normal script where you click a brick to get it in-game, Here is the click the brick script.

local LastNext = tick()
script.Parent.ClickDetector.MouseClick:connect(function(Player)
	if (not Player.Team or Player.Team.Name == 'Admission') and tick()-LastNext > 3 then
		workspace:WaitForChild('BoothSFX').Present:Play()
		game:GetService("Chat"):Chat(Player.Character,'Papers, Please.', 'White')
		LastNext = tick()
	end
end)

So how would I turn this into a GUI button instead of a brick?

Person: Clicks text button Then it makes them say what was in that script.

1 answer

the mouse click event pass in the player object, so you can do everything with the player. Let us say you have put your dialog into a DialogGUI in replicated storage


	local LastNext = tick() 
	script.Parent.ClickDetector.MouseClick:connect(function(Player) 
		if (not Player.Team or Player.Team.Name == 'Admission') and tick()-LastNext > 3 then 
			local gui = game.ReplicatedStorage.DialogGUI:Clone()
			gui.Parent = player.PlayerGui
			gui.Enabled = true
			LastNext = tick() 
		end 
	end) 

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