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

Infinite yield possible on 'Workspace.Felipe:WaitForChild("humanoid")'?

Asked by 5 years ago

I'll explain my situation. so this is a Round script or intermission script you'll notice that when looking at my script below,so when you join a game and the first round start, its fine,but on the second round this is where everything will break.

01for i = GameTime, 0, -1 do
02        if game.Workspace.Felipe:WaitForChild("humanoid").Health == 0  then
03            print("STOP")
04            break
05        elseif game.Workspace.Felipe:WaitForChild("humanoid").Health ~= 0  then
06            print("COUNT")
07            ChangeText('GameTime ' ..i)
08            wait(1)
09        end
10    end

this is where the error is found,the error only shows when on the second round. is there something im missing? cause im confused af. please help!

001--math.randomseed(os.time())
002 
003 
004--// Tables
005Winners = {}
006 
007--// Modules
008Settings = require(script.Settings)
009 
010--// Game Variables
011Intermission = Settings.Intermission
012GameTime = Settings.GameTime
013 
014--// Functions
015 
View all 164 lines...
0
there's a respawn script on the npc Cyrellejheff 11 — 5y
0
try capitalizing the h in humanoid Infocus 144 — 5y
0
the npc's Humanoid name is humanoid so no point of that i guess? Cyrellejheff 11 — 5y
0
After the First Round, check to make sure that the players are still in game.Workspace.Felipe? That might be why? b2lego 30 — 5y
0
It's "Humanoid". For the future, when it does "Infinite yield possible on...", that may mean that the instance cannot be found. User#29913 36 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You spelled humanoid wrong and yes it matters. Its WaitForChild:("Humanoid") Also is Felipe has a a respawn script in him it wont work because he's destroyed. You need a script in severscriptservice and a duplicate of felipe in serverstorage. Also you need a bool value in sever storage make sure its a bool value. At the end of a game make sure in the script you turn the bool value on. Heres the code. PS: make sure you place the duplicate of felipe in workspace a move him were you want and then put him in serverstorage

1local Value = game.ServerStorage.Value
2local MOB = game.ServerStorage.Felipe
3if Value.Value == true then
4    local M = MOB:Clone()
5    M.Parent = workspace
6end
0
you need felipes humanoid spelled Humanoid Nervousmrmonkey2 118 — 5y
0
is there a rule or something that you need a specific name for a Humanoid? Cyrellejheff 11 — 5y
0
i beleive so Nervousmrmonkey2 118 — 5y
Ad

Answer this question