Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Infinite yield possible?? what am i doing wrong?

Asked by 5 years ago
Edited 5 years ago

So i made a morph script where you click a button on a GUI to weld the parts to your character and its not working it's popping up this error:

Infinite yield possible on 'Workspace.HannahToots:WaitForChild("UsingMorph")'

Also the error is on line 13.

"Stack Begin Script 'ServerScriptService.MainScript', Line 13 Stack End"

001-- [[ SERVICES ]] --
002RS = game:GetService('ReplicatedStorage')
003SS = game:GetService('ServerStorage')
004 
005-- [[ SIDE VARIABLES ]] --
006Remote = RS:WaitForChild('MorphRemote')
007Morph = SS:WaitForChild('Morphy')
008-- [[ MAIN SCRIPT ]] --
009 
010function MorphHandler(Player) -- player is automatically a given variable
011    local Character = Player.Character or Player.CharacterAdded:Wait()
012 
013    if Character:WaitForChild('UsingMorph').Value == true then
014        Character.UsingMorph.Value = false
015        for _,limb in pairs(Character:GetChildren()) do
View all 193 lines...

What am i doing wrong? I've checked in play mode the "UsingMorph" value is in the character from the GUI giving it to player on click but still the error shows up.

0
are you giving the UsingMorph value locally and not serversided? Donut792 216 — 5y
0
No its serversided. HannahToots 4 — 5y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
5 years ago

Simple solution. More than likely, you have FilteringEnabled on, which is a good thing, and since you stated it's ServerSided, here's what I feel may be happening:

You said the GUI puts the BooleanValue inside the character. It would be visible client sided, but not server sided. To have it visible from the Server, you'd need to use a RemoteEvent/RemoteFunction to tell the server to put that value inside of the character so it can see it.

1
She already has the RemoteEvent set up, she just needs to pass it the value. Her function should be MorphHandler(Player, useMorph), and she should just send the bool with MorphRemote:FireServer(useMorph). No need for a BoolValue object at all. EmilyBendsSpace 1025 — 5y
0
That works as well. I was more going with the methods she already used, since it'd most likely be more comfortable. +1 For the comment Shawnyg 4330 — 5y
Ad

Answer this question