I tried but it doesnt seem to be working, the script itself is within a button which is in starter GUi if anyone can help me it would be greatly appreciated. It's dealing with multiple game passes here, thanks a lot.

Players = game:GetService("Players")
qp = game:GetService("GamePassService")

function onClicked()
local id = 490861
local id2 = 1060340
local id3 = 1932554
local p = Players:GetPlayerFromCharacter(script.Parent.Parent.Parent.Parent)
if p.Name == vips
or qp:PlayerHasPass(p, id) or
	qp:PlayerHasPass(p, id2) or
	qp:PlayerHasPass(p, id3) then 
p.Character:MoveTo(Vector3.new(562, 321, -235))
p.Character.Cframe = CFrame.new (562, 321, -235)
end
end
script.Parent.MouseButton1Down:connect(onClicked)

3 comments

0

The :PlayerHasPass() function of GamePassService is deprecated. This may be why it isn't working. I'm not sure if this is a client or server doing the checking, or whether or not a client could have used this function in the past. Use the :UserOwnsGamePassAsync() function of MarketplaceService. https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync

0

Also, I wouldn't be checking for ownership of these specific game passes in a local script, I'd be doing it in a server script.

0

how would you getplayer from inside a gui?