for i, player in pairs(plrs) do
if player then
character = player.Character
if character then
-- Teleport them
character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame
table.remove(AvailableSpawnPoints,1)
-- Give them a sword
local id1 = 8539828
local id2 = 8584203
local id3 = 8571239
local mps = game:GetService("MarketplaceService")
game.Players:Connect(function(plr)
if mps:UserOwnsGamePassAsync(plr.UserId, id1) then
local TrailSword = ServerStorage.TrailSword:Clone()
TrailSword.Parent = player.Backpack
if mps:UserOwnsGamePassAsync(plr.UserId, id2) then
local Boombox = ServerStorage.Boombox:Clone()
Boombox.Parent = player.Backpack
if mps:UserOwnsGamePassAsync(plr.UserId, id3) then
local BurningSword = ServerStorage.BurningSword:Clone()
BurningSword.Parent = player.Backpack
elseif not mps then
local Sword = ServerStorage.Sword:Clone()
Sword.Parent = player.Backpack
local GameTag = Instance.new("BoolValue")
GameTag.Name = "GameTag"
GameTag.Parent = player.Character
else
-- There is no character
if not player then
table.remove(plrs,i)
end
end
end
end
COMMUNITY QUESTION
When the game starts it never gives the tools that peoiple bought with the gamepass. Help?
1 answer
try not to use numbers in local names it is easier that way gamepassservice is for game passes marketplace is more for developer products fell free to tell me if something goes wrong
local ServerStorage=game.ServerStorage
local idA=1122
local idB=645646
local idC=615165
local service=game:GetService("GamePassService")
for i, plr in pairs(plrs) do
if plr then
character = plr.Character
if character then
character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame
table.remove(AvailableSpawnPoints,1)
local havesword=false
if plr:PlayerHasPass(plr, idA) then
--pass stuff
local TrailSword = ServerStorage.TrailSword:Clone()
TrailSword.Parent = plr.Backpack --by puting it in back pack the player will always have it even when the respawn
havesword=true --if sword
end
if plr:PlayerHasPass(plr, idB) then
local Boombox = ServerStorage.Boombox:Clone()
Boombox.Parent = plr.Backpack
end
if plr:PlayerHasPass(plr, idC) then
local BurningSword = ServerStorage.BurningSword:Clone()
BurningSword.Parent = plr.Backpack
havesword=true --if sword
end
if havesword==false then
local Sword = ServerStorage.Sword:Clone()
Sword.Parent = plr.Backpack
local GameTag = Instance.new("BoolValue")
GameTag.Name = "GameTag"
GameTag.Parent = plr.Character
end
else
if not plr then
table.remove(plrs,i)
end
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
if this works please accept my answer if not please tell me it does not work and were