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

Output window help, please?

Asked by
Yeevivor4 155
10 years ago

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
0
Please post the actual script. AmericanStripes 610 — 10y
0
Okay Yeevivor4 155 — 10y
0
It's not "parent" it's Parent*. Kozero 120 — 10y
0
Okay, thanks. If you can post it on the real question thingy, I can give you a rep. point. Yeevivor4 155 — 10y

2 answers

Log in to vote
0
Answered by
c0des 207 Moderation Voter
10 years ago

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.

Ad
Log in to vote
-1
Answered by
Kozero 120
10 years ago

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

Answer this question