script.Parent.Equipped:connect(function() Guu = Workspace:FindFirstChild("ScreenGui") Gu2 = Guu:Clone() Gu2.Parent = script.Parent.Parent end)
So I was playing around with Guis today, and after writing a simple script to make a Gui appear when a tool is equipped, I was greeted with no Gui and instead this message: maximum event re-entrancy depth exceeded
The Wiki says that it "is caused by too many events triggering each other", but I'm not sure what that means. What is wrong with my script?
script.Parent.Equipped:connect(function() player = script.Parent.Parent.Parent player:WaitForDataReady("StarterGui").ScreenGui -- Make a screengui in StarterGui Guu:Clone().Parent = player:WaitForDataReady("StarterGui") -- You can't clone StarterGui, it a service but you can clone a screengui end)
maximum event re-entrancy depth exceeded Means that you used the Gu2 the clone more than once though I fixed and it should work. The script creates the Clone of the Gui on the spot and will not exceed the entrance.
+1 if the helped and make sure this question is considered answered if I helped,mk :)