Hey there! I made a VIP gamepass where the player can obtain significanrt benefits compared to a normal player, but I don’t know what to do for what I’m about to explain.
You know how spawn locations work, the usual where players spawn? I want to put in a script where it checks the gamepass ID within the spawner, and spawns the player there. I want to achieve something like this.
local PassId = 00000
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if string.lower(msg) == '!spawn' and MS:UserOwnsGamepassAsync(plr.UserId, PassId) then
Something similar to that code, but instead of that, it’s where the player spawns at an exclusive area for them only.
In simpler terms, it would be like this: Player owns gamepass, spawns at different location with that gamepass.
Is there anyone out there that can help me achieve this? I don’t know where to start, and an example with a script that works would be really nice!
local Players = game:GetService("Players")
local Marketplace = game:GetService("MarketplaceService")
local GamepassId = 0 --Change to ID of gamepass.
local Part = workspace.Part --Example teleport location.
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Success, Result = pcall(function()
return Marketplace:UserOwnsGamePassAsync(Player.UserId, GamepassId)
end)
if Success then
if Result then
Character:PivotTo(Part.CFrame) --Example.
end
end
end)
end)