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

[SOLVED] UserId is not a valid member of model?

Asked by 6 years ago
Edited 6 years ago

Hi, im trying to make a vip room. Im using this script for the vip door

01print("VIP Door Script loaded")
02 
03local Door = script.Parent
04 
05function onTouched(hit)
06    print("Door Hit")
07    local human = hit.Parent:findFirstChild("Humanoid")
08    if (human ~= nil ) then
09        local player = human.Parent
10        -- a human has touched this door!
11        print("Human touched door")
12        -- test the human's name against the permission list
13        if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 4525252) then
14            print("Human passed test")
15            Door.Transparency = 0.5
View all 26 lines...

It gives the error message "userid is not a valid member of model". I guess the human.parent part is wrong, but cant find to what i should change it. I hope you can help me.

Edit: Nevermind i just changed it to game.Players:GetPlayerFromCharacter(hit.Parent) and it works.

0
Can you change the question to [SOLVED] + your title? User#20388 0 — 6y

Answer this question