As with a lot of other posts, this problem is not in test mode but rather in the Roblox "Play" mode. I have a server script that will detect when a player is inside the part "ENTERSHOP" and will make the player's shop GUI visible. When the script detects a player in the Roblox server mode, it is seemingly unable to find the ScreenGui "Gui" as a child of PlayerGui and throws an "Infinite yield possible" error relating to line 10
local part = script.Parent
local debounce = false
part.Touched:connect(function(hit)
if debounce == false then
debounce = true
if hit.Parent:FindFirstChild('Humanoid') then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if plr.PlayerGui:WaitForChild("Gui").Shop.Visible ~= true then
plr.PlayerGui:WaitForChild("Gui").Shop.Visible = true
end
end
end
debounce = false
end
end)
part.TouchEnded:connect(function(hit)
if debounce == false then
debounce = true
if hit.Parent:FindFirstChild('Humanoid') then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if plr.PlayerGui:WaitForChild("Gui").Shop.Visible ~= false then
plr.PlayerGui:WaitForChild("Gui").Shop.Visible = false
end
end
end
debounce = false
end
end)
I know that the scripts are a little sloppy but I plan on cleaning it up after the bugs are fixed.

1 comment
By "roblox server mode" you mean in the actual game? Or in studio play mode?