New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 11 months ago

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

Log in to vote
0
Answered by 11 months ago
Edited 11 months ago

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

Answer this question