My script isn’t working. I’m actually very confused on this since it will open the first time when ClickDetector.MouseClick is fired, but once the gui clone is deleted it does not re-clone and Tween open the cloned gui.
Here is the code:
local Gui
script.Parent.ClickDetector.MouseClick:Connect(function(plrClicked)
if plrClicked.PlayerGui:FindFirstChild("CheckInGuiClone") then
Gui = plrClicked.PlayerGui:FindFirstChild("CheckInGuiClone")
else
Gui = plrClicked.PlayerGui.CheckInGui:Clone()
Gui.Parent = plrClicked.PlayerGui
Gui.Name = "CheckInGuiClone"
end
-- TS = TweenService
TS:Create(Gui.Frame, TweenInfo.new(0.5, Enum.EasingStyle.Bounce, Enum.EasingDirection.InOut), {Size = UDim2.new(0.805,0,0.831,0)}):Play()
wait(0.5)
Gui = nil
end)
I also think the error is in here. :FindFirstChild() doesn’t return a true/false. For some reason, it returns false the very first time but after that it just appears to return nil which stops it from working. There is no error output concerning this script at all.
Code Review is not for broken code. Please use Scripting Support if your code is broken and you are requesting for help on fixing it. Read category guidelines before posting threads. I’ve recategorised this thread accordingly.
The problem is that you used the tween service after the statement that clones the gui into the player, the error is that it can’t find the gui since it’s destroyed and it’s considered a nil instance.