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

Why Does it say attempt to index nil with userId?

Asked by 3 years ago

here is my script: local id = whatever id local market = game:GetService('MarketplaceService') local owner = game.Workspace.TYCOONS.FirstTycoon.TycoonInfo.Owner

game.Workspace.TYCOONS.FirstTycoon.Buttons.Robux.Button.Touched:Connect(function(Hit,player) if Hit and Hit.Parent:FindFirstChild("Humanoid") then local players = game.Players:GetPlayerFromCharacter(Hit.Parent) if players and owner.Value == players then if market:UserOwnsGamePassAsync(player.userId, id) and game.Workspace.TYCOONS.FirstTycoon.Essentials.Conveyor.Value.Value == false then game.Workspace.TYCOONS.FirstTycoon.Essentials.Conveyor.Value.Value = true end end end end)

0
Please format your question and next time add more detail. Based on the title, however, I will tell you that it is player.UserId (capital u) not player.userId. radiant_Light203 1166 — 3y
0
"player" is never defined, did you mean to use "players"? DeceptiveCaster 3761 — 3y

Answer this question