What do you want to achieve? Keep it simple and clear!
I wanna my script open a GUI, when i use it first time GUI opens, but when i use it again it do nothing
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Everything must works fine idk what is problem
local TweenService = game:GetService("TweenService")
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if not plr.PlayerGui:FindFirstChild("GUIClonedfromtouchblock") then
plr.PlayerGui.TraderGui.DialogueFrame.Visible = true
plr.PlayerGui.TraderGui.DialogueFrame:TweenSize(
UDim2.new(0.9, 0,0.2, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Bounce,
true,
0.5
)
end
end
end
end)
local TweenService = game:GetService("TweenService")
local debounce = false
script.Parent.Touched:Connect(function(hit)
if not debounce then
if hit.Parent:FindFirstChild("Humanoid") then
debounce = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if not plr.PlayerGui:FindFirstChild("GUIClonedfromtouchblock") then
plr.PlayerGui.TraderGui.DialogueFrame.Visible = true
plr.PlayerGui.TraderGui.DialogueFrame:TweenSize(
UDim2.new(0.9, 0,0.2, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Bounce,
true,
0.5
)
debounce = false
end
end
end
else
-- REVERSE TWEEN HERE
end
end)
local Text = script.Parent
local AnimateUI = require(game.ReplicatedStorage:WaitForChild("AnimateUI"))
local TextMessage1 = "Huh? So you wanna change your clicks into money?"
local TextMessage2 = "Okay, then let's trade! Remember 10 clicks = 1$"
local TradeButton = script.Parent.Parent.TradeButton
local SecretButton = script.Parent.Parent.SecretButton
local GUI = script.Parent.Parent
local function Message1()
wait(0.4)
AnimateUI.typeWrite(Text,TextMessage1,0.05)
end
local function Message2()
TradeButton.Visible = false
SecretButton.Visible = false
AnimateUI.typeWrite(Text,TextMessage2,0.05)
wait(1)
GUI:TweenSize(
UDim2.new(0.9, 0,0, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Bounce,
true,
0.5
)
GUI.Visible = false
end
GUI.Changed:Connect(function()
if GUI.Visible == true then
Message1()
end
end)
TradeButton.MouseButton1Click:Connect(function()
Message2()
end)
local TweenService = game:GetService("TweenService")
local debounce = false
script.Parent.Touched:Connect(function(hit)
if not debounce then
if hit.Parent:FindFirstChild("Humanoid") then
debounce = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if not plr.PlayerGui:FindFirstChild("GUIClonedfromtouchblock") then
plr.PlayerGui.TraderGui.DialogueFrame.Visible = true
plr.PlayerGui.TraderGui.DialogueFrame:TweenSize(
UDim2.new(0.9, 0,0.2, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Bounce,
true,
0.5
)
debounce = false
end
end
end
end
end)