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 ]] -- |
002 | RS = game:GetService( 'ReplicatedStorage' ) |
003 | SS = game:GetService( 'ServerStorage' ) |
004 |
005 | -- [[ SIDE VARIABLES ]] -- |
006 | Remote = RS:WaitForChild( 'MorphRemote' ) |
007 | Morph = SS:WaitForChild( 'Morphy' ) |
008 | -- [[ MAIN SCRIPT ]] -- |
009 |
010 | function 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 |
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.
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.