#Infinite Yield impossible

1 messages · Page 1 of 1 (latest)

junior oriole
#

Hiya yall i hope im not sliding in to crazy , but i am currently having a issue

  • i basically copied my scripts from 1 place to another, and now i receive this error, even tho the hierarchy has been working completely fine
  • I have added a debug , which would not jump on

I am unsure which code it could be, so i am gonna provide my "CharacterSelection" Gui script here.
If some things may seem AI, yes i have been using it to assist me in some occasion so please dont judge me for that! AI is still a useful tool for me for help
-# i just cant figure my head here what to do anymore since i coded everything right on the other place

My script

-# I couldnt put it into the msg so i pasted it into a TXT file

My hierarchy is also pasted in as a pic

#

Infinite Yield impossible

#

My current output

#

brah

hexed roost
junior oriole
#

wdym does it work?

hexed roost
junior oriole
#

I cant press my "button" here, aka the script rn crashes
since before it worked totally fine on the other game place

#

and normally when pressing this button, a screen pop ups i have made

hexed roost
junior oriole
#

normally there would be a character there, with their stats distributed and so on

#

but it wnt do shi

junior oriole
#

the only thing not is the character stats itself

glad gyroBOT
#

studio** You are now Level 1! **studio

junior oriole
#

but it tells me the mainframe and whatever is missing

#

even though i do have it

#

heres another script of mine, that may have something to do with this, aka mainhud

#

at the beginning it was a child problem

#

so i thoughtitd make it wait a bit longer

#

but that didnt fix anything

hexed roost
junior oriole
#

on the Mainhud or charselect?

hexed roost
junior oriole
#

okay

#

that didnt do much, although i assume its the mainhud script actually

#

because once the HUD script starts, it displays me the infinite yield error

#

it cantfind the child mainframe, even tho i copied it 1:1 the smae

#

and i mean, as u can see above its also inside the starterGUI

#

which esentially means right now my script is crashign on the beginning, but i just dont know what to do anymore since i cant think of why a script i copied 1:1 suddenly doesnt work on my other place

hexed roost
junior oriole
#

im running out of ideas what to do

#

as it still doesnt work...

gentle osprey
glad gyroBOT
#

studio** You are now Level 3! **studio

gentle osprey
#

Script and Interface are both in StarterGui?

gentle osprey
#

Hm

#

Script 'Players.ottaro10.PlayerGui.CharacterSelectionGui', Line 23

#

Its this line?
local template = screenGui:WaitForChild("CharCardTemplate")

junior oriole
#

wdym exactly

gentle osprey
#

Im trying to Track the problem, But im not totally sure what Lines aure causing the Yield

#

Because there is a lot

#

Of Yields

junior oriole
#

yeah, well its mostly coming down to it not finding the "mainframe"

glad gyroBOT
#

studio** You are now Level 2! **studio

junior oriole
#

i copied it 1:1, like the StarterGui section from 1 game to the other

hexed roost
junior oriole
gentle osprey
#

o.

#

Hold on

hexed roost
#

whatd you do

gentle osprey
#

local screenGui = playerGui:WaitForChild("CharacterSelectionGui")

junior oriole
#

the starterplayerscript solution

gentle osprey
#

Yea ofc

#

Yea because

#

local screenGui = playerGui:WaitForChild("CharacterSelectionGui")

#

haha

#

That line

#

was the problem to

junior oriole
#

my brain is lowkey fried so im trying to understand any problem and learn from it 😭

gentle osprey
#

They have the same name

#

It "Worked some times" or "Miracle working" bacause the script was actually taking the Interface

hexed roost
#

so is it a naming collision

glad gyroBOT
#

studio** You are now Level 10! **studio

gentle osprey
#

The other times the script was just naming it self

gentle osprey
junior oriole
#

goddamn

#

okay

#

let me rename it

gentle osprey
#

You should just name the script like a controller

#

InterfaceController

#

or well

#

CharacterSelectionGuiController

#

kinda long name

junior oriole
#

Yeah ill remove the

#

Gui part off the script

#

makes it easier

gentle osprey
#

I also recommend that leaving scripts in the StarterGui isn't always very practical, i mean for small projects or starting projects yea it can work But if you're working on something larger, you'll need to control everything locally from PlayerScripts.

#

In my script this line gets the Interface
InterfaceController.MainUi = ReplicatedStorage.Resources.Interface.MainUI :: CLIENT_TYPE.MainUi

#

And this one just put it directly
InterfaceController.MainUi.Parent = Player.PlayerGui

#

This way i always have control of the MainUi and i can be sure 100% the that Ui and it components exist

junior oriole
#

hmm

#

So how do you recommend a proper reconstructure?

#

itd like to prevent it early on

gentle osprey
#

I mean, Its mostly the way you feel comfortable

#

In my case i like to keep everything as a "Screen"

#

Its like a tree, everything have access to everything, so i can call anything in any point

#

But well, you should take that as an idea, i dont recommend it if you are starting

#

could be a challenge

junior oriole
#

i am pretty much a rookie here

gentle osprey
#

Hope your project goes well

#

gL

junior oriole
#

Thank you, and thanks alot to the quick help!