I have two gamepasses : x2 points and x3 points. When you touch the end part of each minigame, you receive points and the number of points are influenced by the gamepass you own. The gamepasses work fine, but I found out that players without the gamepass are not receiving any points. I looked into the final elseif statement and it turns out it's not running at all for non-gamepass owners. Anyone know why?
local winnames = game.Workspace:WaitForChild("WinNames")
local db = false
script.Parent.TouchEnded:connect(function(hit)
if hit.Parent ~= nil then
if hit.Parent ~= nil and db==false then
db=true
if hit.Parent.Humanoid.Health ~= 0 then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.Settings.Winner.Value = true
local spawns = game.Workspace.Lobby.Spawns:GetChildren()
hit.Parent.HumanoidRootPart.CFrame = spawns[math.random(1,#spawns)].CFrame + Vector3.new (0,3,0)
game.Workspace.NumWinners.Value=game.Workspace:WaitForChild("NumWinners").Value+1
local ownsGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 8896759)
local ownsx3Gamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 8918156)
player.Settings.Winner.Value=false
if ownsx3Gamepass==true then
player.leaderstats.Wins.Value = player.leaderstats.Wins.Value+1
player.leaderstats.Points.Value = player.leaderstats.Points.Value+30
player.earned.Value = player.earned.Value + 30
if ownsGamepass==true then
player.leaderstats.Wins.Value=player.leaderstats.Wins.Value+1
player.leaderstats.Points.Value=player.leaderstats.Points.Value+20
player.earned.Value = player.earned.Value + 20
elseif ownsGamepass==false and ownsx3Gamepass==false then
print("oh no")
player.leaderstats.Wins.Value=player.leaderstats.Wins.Value+1
player.leaderstats.Points.Value=player.leaderstats.Points.Value + 10
player.earned.Value = player.earned.Value + 10
end
end
wait(2)
player.earned.Value = 0
db=false
end
end
end
end)

1 comment
still not working :/ 'oh no' is not being printed (the account im using to test with does not own the gamepass)