Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gamepass "else" statement inside script not working?

This is my gamepass script (Alvinblox made the gamepass script and I put the stuff inside) and I am trying to make it so you get double money (4) if you own the gamepass and normal money (2) per kill if you don't own it.

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        if game.MarketplaceService:PlayerOwnsAsset(player,7187215) then
            game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function() local cv = c.Humanoid:findFirstChild("creator") if cv 
then local k = cv.Value if k and k ~= p then k.leaderstats.Money.Value = 
k.leaderstats.Money.Value+4
end end end) end) end)
else
	 game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function() local cv = c.Humanoid:findFirstChild("creator") if cv 
then local k = cv.Value if k and k ~= p then k.leaderstats.Money.Value = 
k.leaderstats.Money.Value+4
end end end) end) end)
	

        end
    end)
end)

Thanks!

1 answer

✓ Accepted answer

You ended your if statment at line 8.

1 comment

0

oh right lol thx

This discussion is preserved as it was. New answers, comments, and votes are closed.