o when a player purchases a game pass while in-game they don't receive the weapon unless they join another server. How can I fix this?
Here's the script I've been using-
local passId = 162660258
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if isAuthenticated(player)then
tool = game.Lighting["Finger Lazers"]:Clone()
tool.Parent = player.Backpack
end
end)end
And here's a script someone made me to fix it, however this script doesn't seem to be working either.
function onPlayerRespawned(newPlayer)
wait(1)
local Character = newPlayer.Character
local passId = 162660258
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function(property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
if isAuthenticated(player)then
tool = game.Lighting["Finger Lazers"]:Clone()
tool.Parent = player.Backpack
end
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function(property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
end)
end
end
game.Players.ChildAdded:connect(onPlayerEntered)
