You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to add a cool down to the dialogue activation in my game -
What is the issue?
My dialogue can be repetitively used if you are standing on the brick, I need help converting the gui from enabling from standing on the block into being a certain distance away from the part, and have it disable if it is farther then that. I am also trying to make it so that the dialogue can not be activated for 15 seconds after use. -
What solutions have you tried so far?
I tried to look for solutions on the developer hub and on youtube, I can not find anything to help.
Screenshots of Explorer:
(The part used to enable the GUI.)
(The Dialogue UI being enabled from the part.
The Current Script being used for the part:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
game.ReplicatedStorage.Popup:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent))
end
end)
The current script being used for the dialogue:
if game.StarterGui.UncleDialogue.ImageLabel.Visible == true and game.StarterGui.UncleDialogue.TextLabel.Visible == true then
local text = "Hehehe, I'm Uncle Steve."
local text2 = "Now go away so I can gamble."
local text3 = "I said go away."
local text4 = "If you are gonna just stay there,"
local text5 = "then atleast join The Uncles group."
for i = 1, #text do
script.Parent.TextLabel.Text = string.sub(text, 1, i)
wait()
end
wait(5)
for i = 1, #text2 do
script.Parent.TextLabel.Text = string.sub(text2, 1, i)
wait()
end
wait(2.2)
for i = 1, #text3 do
script.Parent.TextLabel.Text = string.sub(text3, 1, i)
wait()
end
wait(2.2)
for i = 1, #text4 do
script.Parent.TextLabel.Text = string.sub(text4, 1, i)
wait()
end
wait(0.6)
for i = 1, #text5 do
script.Parent.TextLabel.Text = string.sub(text5, 1, i)
wait()
end
wait(1.5)
game.Players.LocalPlayer.PlayerGui.UncleDialogue.Enabled = false
end
If anyone can help please reply in the comments.