Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gamepass "else" statement inside script not working?

Asked by
zomspi 541 Moderation Voter
5 years ago

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

Log in to vote
0
Answered by 5 years ago

You ended your if statment at line 8.

0
oh right lol thx zomspi 541 — 5y
Ad

Answer this question