Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Infinite Yield Possible Error? Could use some assistance...

Let me give some context before I go blasting you with my lame programming skills.

So I made a localscript that will detect if the players mouse's target is a "Door", if you click said "Door" you get a transition screen, and thus teleported to your destination. That all works fine and dandy, and when you're teleported a brick named "Teleportation" is created in the last position you were in before teleporting. That way you can get back no problemo. The problem isn't within that local script but in fact is within a server script I created. So, the game is in a top/down perspective, so I made it to where the player has to walk downward into a doorway to exit the building, the problem is, the player isn't teleporting back because the script can't find the brick that the LocalScript created. Even though the brick is obviously in the workspace, the serverscript can't seem to find it. If you're questioning whether the brick is in workspace, don't be. I know it's there, because right before the transition screen activates, you can see it at your feet.

I've also used RemoteEvents to ensure everything fires properly, I'm really at a loss here, and I'll post my serverscript code below. Any help is greatly appreciated.

ServerScript Code: http://prntscr.com/kf33a1

Also, this works in playsolo but not in a server, the error I get is: ("Infinite Yield Possible on ("Teleportation")

I'll also post my Local Script Code if that helps.

LocalScript Code: https://pastebin.com/QEat95Pz

Thanks again, and if you have any questions please message me.


2 comments

0

It's not an error, it's a warning as I have previously stated. You cannot get rid of it, it is always there when using WaitForChild.

0

I understand that, but you're still not understanding the issue. Nor have you given me a way to at least fix it. I've posted both bits of my code and even provided an explanation and context beforehand.

1 answer

The part is being created in the Local Script meaning it is getting created Client Side Only. The server cannot see it. Remember all games are FE now whether you enable it or not.

6 comments

0

I understand all games are FE now, which is why I use RemoteEvents reiligiously. How else should I create the part then? I have a remote event fire when it happens, so it should've been serverside.

0

You need to create the part in a remote event and fire that remote event in the local script in place of creating the part. Right now you are just creating the part locally.

0

I think I understand what you're saying, I'll give it a shot.

0

Sounds good, let me know

0

Is there a way for me to get the players character with a server script? I keep getting "character" is a nil value error.

0

Assuming the player value is defined and not nil then use: Player.Character or if it is coming out nil: Local Character = Player.CharacterAdded:Wait()

This discussion is preserved as it was. New answers, comments, and votes are closed.