Errors: None
local SkipAnimID = 944401378 game.Players.PlayerAdded:connect(function(player) if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, SkipAnimID) then print("Worked") else wait(10) end end)
The function PlayerOwnsAsset no longer works with game passes or badges so you now must use the corresponding service to check this kind of data.
All you need to do is change this script to use the function PlayerHasPass which is only accessible on the server side.
Example, serser script:-
local gamePassServ = game:GetService('GamePassService') game.Players.PlayerAdded:connect(function(plr) if gamePassServ:PlayerHasPass(plr, 944401378) then -- You may also need a remote event to let the player know they have the gamepass else wait(10) -- ?? end end)
I hope this helps.
Hi.
If this is a server script located inside of a GUI and FE is enabled, the script will not work. If this is local script, it will not work.
However you can make it work using a Server script
and a remote event
.
Here is an example:
--SERVER SCRIPT inside of ServerScriptService local Event = Instance.new("RemoteEvent") Event.Parent = game:WaitForChild("ReplicatedStorage") Event.Name = "SkipAnim" local SkipAnimID = 944401378 game.Players.PlayerAdded:connect(function(player) if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, SkipAnimID) then Event:FireClient(player) else wait(10) end end) --LOCAL SCRIPT inside of GUI game:WaitForChild("ReplicatedStorage"). local Event = game.ReplicatedStorage:FindFirstChild("SkipAnim") Event.OnClientEvent:connect(function(player) print ("Player has pass") --The rest of code goes here end)
Hope this helps!