So I have this in a local script in a text button that is in a gui, that is in startergui. The script is supposed make the gui only seeable to the players that own the gamepass and when clicked will give the player a higher jump. It doesn't seem to be working could someone tell me whats wrong?
local player = script.Parent.Parent.Parent.Parent.Parent
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, 4916610) then
script.Parent.MouseButton1Click:connect(function()
game:GetService("Players").PlayerAdded:Connect(function(plr) -- :connect is deprecated, use :Connect
plr.CharacterAdded:Connect(function(char) -- wait for the character!
if isAuthenticated(plr.UserId, passId) then
char.Humanoid.JumpPower = char.Humanoid.JumpPower + 30
end
end)
else
script.Parent.Visible = false
end

2 comments
"UserId" is spelt wrong on line 3.
Dude why do you use player as 50 parents