So... I'm making a game with a vip gamepass. This script apparently doesn't affect people that don't have the gamepass. No idea why.
script.Parent.Touched:connect(function(hit,player)
local passId = 724007686
local function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
local function Start(player)
print(player.Name .. " has bought the game pass with id " .. passId)
end
if isAuthenticated(player) then
return
else
hit.Parent.Humanoid.Health = 0
end
end)
Thanks.

1 comment
Every time a the touched event fires it connects new function to the PlayerAdded event??