✓ Accepted answer
Hello Joshuadr737. There are a few apparent issues I see in your code. The main one being your method is deprecated! Lets begin. I'm going to provide a new and more clear way to show you how everything should be formatted. Here we go:
Setup
- Create a Script in ServerScriptService
- Make a part in workspace
- Name it "GamepassOwnedPart"
Script Making
GamePassCheck:
MPS = game:GetService("MarketPlaceService")
GamePassID =
Indicator = workspace:WaitForChild("GamepassOwnedPart")
game.Players.PlayerAdded:Connect(function(plr)
local plrID = plr.UserId
if MPS:UserOwnsGamePassAsync(plrID,GamePassID) then
Indicator.BrickColor = BrickColor.new("Really Red")
end
end)
Script Context
In the game pass check script, we first detect when a new player is joining. From there, we get the players unique ID, and check if they own the gamepass with that ID. If they do, we change the bricks color to red.
With any further questions/comments/concerns, please feel free to reply to my post or comment! ~mc3334
1 comment
try using the player's User Id. "if service:PlayerHasPass(player.UserId,gamepass.Value) then