local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local passId = 4764164
local function onPlayerAdded(player)
local hasPass = false
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, passId)
if hasPass == true then
game.StarterGui.guimobile.Omnitrix.Frame.Visible = true
if hasPass == false then
game.StarterGui.guimobile.Omnitrix.Frame.Visible = false
end
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
I'm a beginner at scripting so I don't know much about why it's wrong.

2 comments
Could you change the script for me and put it in a code block? I did it myself and it didn't work, sorry for asking so much
Okay.