This is a script that teleports a character to a certain place. While UI creates, it teleports to the wait area (to not interfere other players use teleport). And when UI removes, it teleports to the destination. However, sometimes it fails to teleport a character with bad network (as i know) for unknown reason.
The code itself:
local chr = plr.Character
CreateMovingGUI(plr)
task.wait(1)
if chr.Parent~=nil then
plr:RequestStreamAroundAsync(v.WaitBox.TP.Position,10)
chr:PivotTo(v.WaitBox.TP.CFrame)
UpdateMovingGUI(plr,"Moving to the area...",MoveTimeVent)
task.wait(1)
if chr.Parent~=nil then
plr:RequestStreamAroundAsync(v.C1_Pos.Position,5)
chr:PivotTo(v.C1_Pos.CFrame)
RemoveMovingGUI(plr)
end
end
The issue:
On the image you can see the player stuck in the wait area and had to reset his character to solve the issue. The code itself is fine and don’t get any error. There is no any infinite yielding process (even in the RequestStreamAroundAsync) because the code finishes completely after the GUI removes.
The game is also using StreamingEnabled feature because the game is very big itself and it would be very laggy without it. I don’t know but maybe this information will help somehow. Any help would be appreciated. I just want to know how to solve that issue or avoid at least.