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

How to make dialog appear from an onClick?

Hello! How are you today? I'm having a little issue. I want this script to make dialog appear when a part is clicked. Then after the dialog vanishes, you earn the badge. I believe I have the badge part done. Now I need the dialog part. I'm not a very advanced scripter, I'm still learning. Here's the script.

local badgeID = 498801288
local badgeService = game:GetService("BadgeService")


function onClicked(playerWhoClicked)
    wait(4)
	badgeService:AwardBadge(playerWhoClicked.userId, badgeID)
end
 
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Script puts up a textlabel on the top left of the screen saying "prety sp00ky amirite?!?!" also destroys ClickDetector once it has been clicked, and destroys the screengui after 4 seconds.

local badgeID = 498801288
local badgeService = game:GetService("BadgeService")
local p = game.Players.LocalPlayer --Gets the specific player from the Players

function onClicked(playerWhoClicked)
    script.Parent.ClickDetector:Destroy()
    local p = game.Players.LocalPlayer
    local xd = Instance.new("ScreenGui")
    xd.Parent = p.PlayerGui
    local tb = Instance.new("TextLabel")
    tb.Parent = xd
    tb.Size = UDim2.new(0.145,0,0.052,0)
    tb.Position = UDim2.new(0,0,0,0)
    tb.Text = "prety sp00ky amirite?!?!"
    wait(4)
    xd:Destroy()
    badgeService:AwardBadge(playerWhoClicked.userId, badgeID)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 comment

0

Sorry if I confused you, but I meant dialog as in the thing that appears when you click the question mark or exclamation point.

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