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

Output window help, please?

The output window says that "parent is not a valid member of Workspace". I am trying to make a minigame and in my Lighting (which contains the model) it has:

-Model (also named Pig), minigame, time, winner, Part, Part

	while true do 
	wait(1)
	script.Parent.time.Value = script.Parent.time.Value - 1 
end 


function personWon(person)
	if not person.Parent then return end 

		local player = game.Player:getPlayerFromCharacter(person.Parent)
	
		if player then 
	script.Parent.Winner.Value = player
	end  
end

script.Parent.won.Touched:connect(personWon)


function loadMinigame(mg)
	local m = mg:clone()
	m.parent = Workspace 
	return m 
	end

4 comments

0

Please post the actual script.

0

Okay

0

It's not "parent" it's Parent*.

0

Okay, thanks. If you can post it on the real question thingy, I can give you a rep. point.

2 answers

✓ Accepted answer

On line 10, it says "game.Player:getPlayerFromCharacter(person.Parent)" "Player" should have an S at the end, like so:

game.Players:getPlayerFromCharacter(person.Parent)

The reason for this is that you are accessing the Players list, not the "Player" list.

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