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.
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)